ON THE COMPLEMENTARY FACTOR IN A NEW CONGRUENCE ALGORITHM

In an earlier paper the authors described an algorithm for determining the quasi-order, Q t ( b ) , of t mod b , where t and b are mutually prime. Here Q t ( b ) is the smallest positive integer n such that t n = ± 1 mod b , and the algorithm determined the sign ( − 1 )  ϵ  ,  ϵ  = 0 , 1 , on the right of the congruence. In this sequel we determine the complementary factor F such that t n − ( − 1 )  ϵ  = b F , using the algorithm rather that b itself. Thus the algorithm yields, from knowledge of b and t , a rectangular array 
 a 1 a 2 … a r k 1 k 2 … k r  ϵ  1  ϵ  2 …  ϵ  r q 1 q 2 … q r 
The second and third rows of this array determine Q t ( b ) and  ϵ  ; and the last 3 rows of the array determine F . If the first row of the array is multiplied by F , we obtain a canonical array, which also depends only on the last 3 rows of the given array; and we study its arithmetical properties.

Qt (b)  algorithms for determining Qt(b) and for deciding whether t m +I mod b or Qt (b)   t -1 mod b.In fact, our algorithms provide us with a residue E mod 2 such Qt (b)   that t ---(-I) mod b.In this paper, which can be viewed as a sequel to [HP], we give an algorithm for determining the complementary factor F such that Qt (b)   t (-1) bF (0.0) and study F as a function of tand b.Of course, a conceptually simple algorithm for Qt (b)  ) determining F would be to divide t (-i by b; however, our algorithm is based on a (reduced, contracted) symbol associated with b, and not on knowledge of b itself.This approach enables us to pursue the analysis of canonical symbols in Section 2. Such symbols may be viewed as generating the entire set of symbols.
Let us recall the b-algorithm from [HP] and the notion of a symbol.Given t,b as above, we aefine S to be the set of integers a satisfying a < b t# a (0.1) O< t-lif Given a .S, we consider the integers qb + (-l)a, 0 or I, where <_ q <_ 2 t is odd; < q < if t is even and I; < q <if t is even and O.We claim that, whether t is odd or even, there is exactly one value of q in the given ranges such that tlqb + (-l)Ea for some c.We choose this value of q and thus define a function a a', where qb + (I) a tka ', k >_ I, t a' (0.2) Then the function a a' is a permutation of .We regard E as a residue mod 2 and define a symbol (or t-symbol) by means of the system of equations qi b + (-I) la t lai+I, 1,2 r, ar+ a (0.4) Our notation for a symbol is more complete than in [HP], since there we included neither the qi nor t in the notation.
We recall that gcd(b,ai) is independent of and we call (0.3) reduced if gcd(b,ai) I.We also call (0.3) contracted if there is no repetition among the a i.
The main theorem of [HP] was the following.
Quasi-Order Theorem Let (0.3) be a reduced and contracted symbol.Let k ?,ki, l.
Then k is the quasi-order of t mod b and indeed t k--(-I) mod b Actually, we have introauced a very slight change into the description of the algorithm compared with [HP].For there we considered the set S of integers given by 0 < a < , t # a, and the permutation of S. By allowing a we enlarge S to , the enlargement being actual only if b is even, t is odd.But then () (0.5) We call such symbols trivial, and note that the only reduced and contracted trivial symbol, for a given odd t, is 2 i 0 (t odd).
(0.6) However, this symbol completes the Quasi-Order Theorem, which, in the version in [HP], excluded the case b 2 and hence excluded the trivial fact that the quasi-order of t mod 2 is if t is odd.
We base our algorithm for calculating the complementary factor, in Section I, on the symbol (0.3) or, equivalently, the equations (0.4).Indeed, we construct a symbol tk_(-1 qr t from the data of the last 3 rows of (0.3).We show that there is always such a symbol for an arbitrary choice of positive integers kl, k 2 k r, rood 2 residues el' 2 Or' and positive integers ql' q2' qr subject to the conditions < qi <if t is odd, < qi < if t is even and i I; _< qi <if t is even and i O. (0.8) Indeed, there is then a unique symbol (0.7), which we call a canonical symbol.If the symbol (0.3) is given, then the symbols (0.3), (0.7) are related by the rule (t k (-1)e)ai bA i, (0.9)

A
showing that the complementary factor is any of the equivalent ratios However, since we calculate A simply as a function of the last 3 rows of (0.7), we may consider canonical symbols independently of their relation to the computation of the complementary factor.In fact, Section 2 is devoted to such a study of canonical symbol s.
Suppose then that we start with a canonical symbol (0.7); such a symbol is not necessarily either reduced or contracted.Let gcd (tk-(-1)E, Ai) d.Then we obtain from (0.7), by reducing and contracting, a symbol qs t tk_(-l) and every reduced, contracted t-symbol is so obtained.Writing b' d we then know that the quasi-order of t mod b' is k' kl+k2+...+ks and that + + + tk'_: ,_i ,k 2 mod b'.

THE COMPLEMENTARY FACTOR
We proceed to solve the set of equations (0.4) (in the 'unknowns' ai) qi b + (-1) la t lai+1, 1,2 r (ar+ al). (I.I) It will be convenient henceforth to regard the index as belonging to the set of residues modulo r, so that we may, in practice, use any integer as an index.Now the determinant of the matrix of coefficients in the equations (1.1) is easily seen to be Thus the set of equations (1.1) has a unique solution, whatever values are given to k k r (subject to the restraint k >_I stated in the Introduction);

El' 2
Er; ql' q2 qr" Our procedure is to set B t k (I) and solve the associated system of equations + (-I) IA t 1Ai+ 1,2 r (1.3) qi B then the solution of (1.1) is given by Ba bA 1,2 r (1.4) Since the solution of the system (1.3) is unique, it suffices to find numbers AI, A 2 A r satisfying (1.3).We claim that the following values of these numbers do indeed satisfy (1.3).Thus we set where Ci-l+ei-2 +'" "+ei Cs, (-i)   -S+lqi_s s 1,2 r.
To prove our claim, we first note that +E.
F Ai, where A is liven   Of course, as this second example shows, it is frequently quicker, with a calculating device, simply to divide tk-(-l) by b to obtain the complementary factor.However we wish to emphasize that we may define integers A by means of the equations (1.3), even if no symbol (0.3) had previously been considered.Thus we may specify the sequences k I, k 2 kr; I' 2 r; ql' q2 qr subject to the appropriate constraints, and then set B tk-(-l) and determine the integers A I, A 2 A r by means of (1.3) or, equivalently,.(1.5).This becomes particularly relevant in view of the following theorem.k 2 c q q2 qr Theorem 4 Given the sequences k k r, i' 2 r' I' subject to the appropriate constraints, set B tk- (-l) .Then there exists exactly one symbo qr (1.12) and A is liven by (1.5), 1,2 r.
Proof The uniqueness is obvious.Thus the force of the theorem is that (1.12) is a symbol, that is, that B 0 < A < (1.13) of course, it is clear from (1.5) that A is an integer.
To prove (1.13), we first observe that it is plain from (1.3) that if A B all i, then A > 0 for all i.Thus we have only to prove A <_ Assume first that t is odd.Then qi <-' so that, by (1.5), A <-(t k-I + t k-2 + + i) tk i<__ B <for Now assume t even.If t 2, then Ei I, qi 1, so 2 IAi+l, k _> 1, so Ai+ < for all i, as required.Thus we may assume t > 4.
We call a symbol (1.12) a canonical symbol.Note that a canonical symbol can be trivial.For if t is odd then the symbol, with k columns, tk-1 tk_l tk_l 2 t-1 t-1 2 T is trivial, and is plainly canonical.
Remark If we had obtained (1.12) from the symbol (0.3) the inequalities (1.13) would, of course, have followed immediately from (1.4).However, we now know that such a symbol (1.12) exists (and is unique) for any allowable selection of kl' k2 kr; I' 2 r; ql' q2 qr" In the next section we make a more detailed study of canonical symbols.

CANONICAL SYMBOLS
We first prove some easily accessible lemmas relating to the canonical symbols (1.12).Lemma 2.1 In the symbol (1.12),A is independent of ki_ I.
Proof See (I.5).be a non-trivial symbol.Then it is canonical, so that a A i.
Remark Notice that we must insist that (2.1) is non-trivial.For, if t is odd, tk+1 tk+l is a (trivial) non-canonical symbol.
Our next lemma is a portmanteau enunciation on quasi-orders; recall the notation Qt(b) Let Qt(b) , and k u + v, O <__ v <.Then tv +t k=_ _+I hod b, so Let Qt(b) k.Then t km +1 hod b, so t k m +1 hod c.Apply (i).Cr ql q2 q2 t is reduced and contracted, so that, by our main theorem, Qt(c) k.
Theorem 2.5 If (2.2) is a non-trivial contracted symbol, it may be expanded to a canonical symbol.
Proof We know by Lemma 2.4 thatI k.Thus we may expand (2.2) to a symbol (2.1)   which is also, of course, non-trivial.Apply Lemma 2.2.
It follows that any non-trivial t-symbol for tk + may be contracted-expanded to a canonical symbol, so that the first row of the symbol may be computea from the remaining 3 rows by means of formula (1.5).Example Consider the symbol 624 24 2 5 This expands to 624 24 24 2 2 which is canonical.
We now proceed to relate canonical symbols for different values of ki; to this end, we write Ai(k) instead of A i- Proof This follows immediately from Lemma 2.1.
The force of this theorem is the following.We start with b t k + and any and construct a contracted t-symbol.By Theorem 2.5 we know it may be a < expanded to a canonical symbol S. If we now replace k by (k+1) and retain the same a I, the t-symbol we obtain (perhaps not contracted) (i) has the same ci as S, (i i) has the same qi as S, (iii) has the same k as S, < < r-l, (iv) has the final k r increased by 1.
Example As in our previous example, start with 54-1 624 24 2 , b even).
Let gcd(b,ai) d, b cd, a aid.