ON THE BASIC CHARACTER OF RESIDUE CLASSES

ON THE BASIC CHARACTER OF RESIDUE CLASSES P . HILTON, J . HOOPER AND J . PEDERSEN Let t, b be mutually prime positive integers . We say that the residue class t mod b is basic if theie exists n such that ta -1 mod b; otherwise t is not basic. In this paper we relate the basic character of t mod b to the quadratic character of t modulo the prime factors of b. If all prime factors p of b satisfy p 3 mod 4, then t is basic mod b if t is a quadratic nonresidue mod p for all such p ; and t is not basic mod b if t is a quadratic residue mod p for all such p. If, for all prime factors p of b, p 1 mod 4 and t is a quadratic non-residue mod p, the situation is more complicated . We define d(p) to be the highest power of 2 dividing (p 1) and postulate that d(p) takes the same value for all prime factors p of b. Then t is basic mod b. We also give an algorithm for enumerating the (prime) numbers p lying in a given residue class mod 4t and satisfying d(p) = d. In an appendix we briefly discuss the case when b is even . 0. Introduction In a series of papers [1,through 4], culminating in the monograph [5], Hilton and Pedersen developed an algorithm in fact, two algorithms, one being the reverse of the other for calculating the quasi-order of t mod b, where t, b are mutually prime positive integers, and determining whether t is basic mod b . Here the quasi-orden óf t mod b is the smallest positive integer k such that t k ± 1 mod b ; and t is said to be basic if, in fact, tk -1 mod b . Thus t is basic if and only if the order of t mod b is twice the quasi-order of t mod b (in the contrary case the quasi-order and the order coincide. Froemke and Grossman carried the number-theoretical investigation considerably further in [6] and drew attention to the importance, where b is prime, of the quadratic character of t mod b in their arguments . Our object in this paper is to relate the basic character of t mod b to the quadratic character of t modulo the prime factors of b. We assume b odd, but add a few remarks in an appendix on the case when b is even . Given a pair (t, p) where p is an odd prime not dividing t, we distinguish 4 possibilities as follows : 9t may or may not be a quadratic residue mod p, and we may have p 1 mod 4 or p 3 mod 4 . We restrict attention, in our 214 P . HILTON, J . HOOPER, J . PEDERSEN discussion of the basic character of t mod b, to the situation in which all prime factors p of b place (t, p) in the same class . If t is a quadratic residue mod p and p 1 mod 4, we are unable to draw any general conclusion about the basic character of t mod p . Thus, for example, 77 1 mod 29, 77 -1 mod 113, and 7 is a quadratic residue modulo 29 or 113 . If all prime factors p of b satisfy p 3 mod 4, it is easy to draw general conclusions about the basic character of t mod b; our results are given in Section 2. The most interesting case for our purposes is that in which t is not a quadratic residue mod p and p 1 mod 4, for all prime factors p of b. It then becomes important to be able to calculate the function d(p), where d(p) = d if p = 1 +2de, with e odd . Thus d is a positive integer and, in fact, d >_ 2 in the case we are discussing . Since the quadratic character of t mod p depends only en the residue class of p mod 4t, we give an algorithm for enumerating those primes p, as functions of s and d, such that (0 .1) d(p) = d, p s mod 4t, 1 < s < 4t 3 . If the prime factors p of b are confined to those satisfying (0.1) for fixed s, d, then, as we show in Section 3, t is basic mod b. In Section 1 we announce some elementary results which are used in proving our main theorems . Throughout the papes we use the symbol e for a number which is +1 or -1 . 1 . Some preliminary lemmas The first result extends to the quasi-order a familiar result en order. Lemma 1 .1 . Let the quasi-order of t mod b be n and let te mod b. Then nim . Proof. Let m = qn + r, 0 <_ r < n, and tn 77 mod b, q = ±1. Then t , = tm (t , )-9 = 6779 = ±1 mod b, so that r = 0. We now restrict b by the condition b >_ 3, so that the basic character of t mod b comes into question . Lemma 1 .2 . The residue t mod b is basic if and only if t'n -1 mod b for some exponent m. Proof. The necessity of the condition is obvious . Suppose then that t'n = -1 mod b and that the quasi-order of t mod b is n. Then n 1 m, by Lemma 1 .1 . Thus, if tn = 1 mod b, it follows that t' = 1 mod b. This contradiction shows that tn -1 mod b, so that the residue t mod b is basic . THE BASIC CHARACTER oF RESIDUE CLASSES 215 Lemma 1 .3 . The residue t mod b is non-basic if t'n 1 mod b for some odd exponent m. Proof.. Let the quasi-order of t mod b be n with tn e mod b. Then n 1 m, so that m = nq. Since m is odd, q is odd . Thus t'n e9 = e mod b, so e = 1 and the residue t mod b is non-basic . Our next result is of a different kind . Proposition 1 .4 . Le¡ x y mod m. Then XMk-1 = ymk-1 mod mk , k>1. Proof. We argue by induction on k, the case k = 1 being trivial . If we assume xmk1 = ymk-1 mod mk for a certain k > 1, then xmk-1 = ymk-1 + Am k, so that mk mk-1 + Amk m = ymk + AMk+1ym k-1 (m-1) + r m l ~\2 m2kymk-1 (m-2) + 22 y m mod mk+1 . This establishes the inductive step, and hence the proposition . We have the immediate consequence : Lemma 1 .5 . Let c e mod m, with m odd. Then cmk-1 = e mod mk, k > 1 . Proof. We have only to note that e"k-1 = e if m is odd . 2. The main results We recall the following key results on quadratic reciprocity. Theorem 2.1 (Euler). Le¡ p be an odd prime. Then (i) t p 21 1 mod p if and only if t is a quadratic residue mod p (ii) t p2 1 -1 modp if and only if t is not a quadratic residue mod p. Theorem 2 .2 (Gauss) . Let p be an odd prime. Then the quadratic character of t mod p depends only on the residue class of p mod4t and is the lame for two odd primes p and q such that p -q mod4t . 216 P . HILTON, J . HOOPER, J . PEDERSEN Thus, given t and p, we distinguish 4 classes into which the pair (t, p) may fall : I p 1 mod 4, t P 2 l mod p; II p-1mod4,t _21 --1 mod p ; IIIp-3mod4,t 2 1modp; IV p 3 mod 4, t_21 T -1 mod p ; We will say nothing further about residues t mod b if b admits a factor p such that (t, p) is in class I . We will henceforth, until otherwise stated, assume that b is odd. Theorem 2.3 . Suppose that ¡he prime factors p of b are all such that (t, p) is in Class III. Then the residue t is not basic mod b . Proof. Let b = Hay=1Pk¡, k i > 1 . Then is odd and t P, 2 1 1 mod pi . By Lemma 1 .5, t1 1 Pk' -I 1 mod pi' . Set m = IIN1(zl )Pk` -1 . Then m is odd, and 1 mod pk` . It follows that t"° 1 mod b, so that, by Lemma 1.3, the residue t is not basic mod b. Theorem 2 .4 . Suppose that the prime factors p of b are all such that (t, P) is in Class IV Then the residue t is basic mod b. Proo£ We argue as for Theorem 2 .3, except that now t' -1 mod P;', t' -1 mod b, with m odd . We apply Lemma 1 .2 to obtain the result . Example 2.1 . Let t = 7 . Then, by Theorem 2.2, we must consider primes p mod 28 . We easily find p 1 or 27 mod 28 : 7 p 2 1 1 mod p p 3 or 25 mod 28 : 7 p 2 1 =1 mod p p 5 or 23 mod 28 : 7-21 -1 mod p p 9 or 19 mod 28 : 7 , z 1 1 mod p p 11 or 17 mod 28 : 7-= -1 mod p p 13 or 15 mod 28 :7-21 = -1 mod p THE BASIC CHARACTER OF RESIDUE CLASSES 217 Thus (7, p) is in Class I if p 1, 9, 25 mod 28 ; (7,p) is in Class II if p 5,13,17 mod 28 ; (7,p) is in Class III if p 3,19, 27 mod 28 ; . (7,p) is in Class IV if p 11, 15,23 mod 28 . We conclude that 7 is not basic mod b if b is a product of primes p such that p 3,19 or 27 mod 28 ; and 7 is basic mod b if b is a product of primes p such that p 11,15 or 23 mod 28 . As we have said, no inference can be drawn if b is a product of primes p such that p 1, 9 or 25 mod 28 . Indeed, the fact that (7, p) is then in Class I is a special case of the following phenomenon, which we describe here for the sake of completeness . Proposition 2 .5 . Le¡ p be an odd prime such that p = kz -}41 . Then any factor of l is a quadratic residue mod p. Proof. It suffices to prove this for prime factors q of l . Now if q = 2, then p 1 mod 8, so 2 is a quadratic residue mod p. If q is odd, then p is a quadratic residue mod q and p z l is even, so that, by quadratic reciprocity, q is a quadratic residue mod p . Note that it follows, by Theorem 2.1, that 72 1 mod p if p or 25 mod 28 . We will devote the next section to a discussion of the Class II . At this point, we are content to remark Theorem 2.6 . Suppose that b = residue t is basic mod b. Proof. t ( P21 )pk-1 -1 mod pk . Apply Lemma 1 .2 . In the next section we generalize this obvious conclusion . 3. The class II situation We define a function d from positive integers >_ 2 to non-negative integers by (3 .1) d(n) = d !--1 2d 1 (n 1), 2d+1X(n 1) . where (t, p) is in Class II. Then the Notice that, for an odd prime p, d(p) >_ 1 and that d(p) >_ 2 if (t, p) is in Class II . Let d be a fixed integer >_ 2 ; we then have the following theorem, generalizing Theorem 2.6 . 220 P . HILTON, J . HOOPER, J . PEDERSEN in this way, splitting the inequality d(p) > d into the two possibilities d(p) = d or d(p) > d + 1 . We demonstrate this tree in Figure 1 . mod 1+2N b, N>M 2M a d>M 1+2N b 1+2Nb+2Ma 2M+la if N =M stops, d = M goes on, d >_ M+ 1 if N > M goes on, d > M+ 1 stops, d = M General Case Figure 1 p 5 mod 28 Special Case Figure 1 The tree provides the conceptual basis for the proof (see Theorem 3.2),that the primes p satisfying the congruence p 2dc + 1 mod 2d+iu constitute the totality of the primes p satisfying p s mod 4t and d(p) = d. For we may argue by induction on d that there is only one residue class mod 2d+iu containing such primes . We assume n > m + 2 and we rewrite (3.4) as (3.11) 2dc(d) 2nv mod u, THE BASIC CHARACTER op RESIDUE CLASSES 221 to emphasize the dependence of c on d; recall d >_ m+2. We start the induction (and the tree) by rewriting p s mod 4t, using (3.11), as (3.12) p 1+2-+2C(m -}2) mod 2rn+2u . Then (3 .12) branches into the two congruences


Introduction
In a series of papers [1,through 4], culminating in the monograph [5], Hilton and Pedersen developed an algorithm -in fact, two algorithms, one being the reverse of the other -for calculating the quasi-order of t mod b, where t, b are mutually prime positive integers, and determining whether t is basic mod b .
Here the quasi-orden óf t mod b is the smallest positive integer k such that t k -± 1 mod b ; and t is said to be basic if, in fact, tk --1 mod b .Thus t is basic if and only if the order of t mod b is twice the quasi-order of t mod b (in the contrary case the quasi-order and the order coincide.Froemke and Grossman carried the number-theoretical investigation considerably further in [6] and drew attention to the importance, where b is prime, of the quadratic character of t mod b in their arguments .
Our object in this paper is to relate the basic character of t mod b to the quadratic character of t modulo the prime factors of b.We assume b odd, but add a few remarks in an appendix on the case when b is even .
Given a pair (t, p) where p is an odd prime not dividing t, we distinguish 4 possibilities as follows : 9t may or may not be a quadratic residue mod p, and we may have p -1 mod 4 or p -3 mod 4. We restrict attention, in our discussion of the basic character of t mod b, to the situation in which all prime factors p of b place (t, p) in the same class.If t is a quadratic residue mod p and p -1 mod 4, we are unable to draw any general conclusion about the basic character of t mod p.Thus, for example, 77 -1 mod 29, 77 --1 mod 113, and 7 is a quadratic residue modulo 29 or 113 .If all prime factors p of b satisfy p -3 mod 4, it is easy to draw general conclusions about the basic character of t mod b; our results are given in Section 2.
The most interesting case for our purposes is that in which t is not a quadratic residue mod p and p -1 mod 4, for all prime factors p of b.It then becomes important to be able to calculate the function d(p), where d(p) = d if p = 1 +2 de, with e odd .Thus d is a positive integer and, in fact, d >_ 2 in the case we are discussing .Since the quadratic character of t mod p depends only en the residue class of p mod 4t, we give an algorithm for enumerating those primes p, as functions of s and d, such that If the prime factors p of b are confined to those satisfying (0.1) for fixed s, d, then, as we show in Section 3, t is basic mod b.
In Section 1 we announce some elementary results which are used in proving our main theorems.
Throughout the papes we use the symbol e for a number which is +1 or -1 .

. Some preliminary lemmas
The first result extends to the quasi-order a familiar result en order.
Lemma 1 .1.Let the quasi-order of t mod b be n and let t--e mod b.
We now restrict b by the condition b >_ 3, so that the basic character of t mod b comes into question.Lemma 1 .2 .The residue t mod b is basic if and only if t'n --1 mod b for some exponent m.
Proof.The necessity of the condition is obvious .Suppose then that t'n = -1 mod b and that the quasi-order of t mod b is n.Then n 1 m, by Lemma 1 .1.Thus, if tn = 1 mod b, it follows that t' = 1 mod b.This contradiction shows that tn --1 mod b, so that the residue t mod b is basic .Proof.. Let the quasi-order of t mod b be n with tn -e mod b.Then n 1 m, so that m = nq .Since m is odd, q is odd.Thus t'n -e9 = e mod b, so e = 1 and the residue t mod b is non-basic .
Proof.We argue by induction on k, the case k = 1 being trivial .If we assume This establishes the inductive step, and hence the proposition .
We have the immediate consequence : Proof.We have only to note that e"k-1 = e if m is odd.

The main results
We recall the following key results on quadratic reciprocity.Theorem 2 .2(Gauss) .Let p be an odd prime.Then the quadratic character of t mod p depends only on the residue class of p mod 4t and is the lame for two odd primes p and q such that p --q mod 4t .
Thus, given t and p, we distinguish 4 classes into which the pair (t, p) may fall: I p -1 mod 4, t P 2 -l mod p; II p-1mod4,t _21 --1 mod p; IIIp-3mod4,t 2 1modp ; IV p -3 mod 4, t _ 2 1 T -1 mod p; We will say nothing further about residues t mod b if b admits a factor p such that (t, p) is in class I.We will henceforth, until otherwise stated, assume that b is odd.It follows that t"°-1 mod b, so that, by Lemma 1.3, the residue t is not basic mod b.
Theorem 2 .4 .Suppose that the prime factors p of b are all such that (t, P) is in Class IV Then the residue t is basic mod b.
Proo£ We argue as for Theorem 2 .3,except that now t' --1 mod P;', t' --1 mod b, with m odd .We apply Lemma 1 .2 to obtain the result .As we have said, no inference can be drawn if b is a product of primes p such that p -1, 9 or 25 mod 28.Indeed, the fact that (7, p) is then in Class I is a special case of the following phenomenon, which we describe here for the sake of completeness .Proposition 2 .5 .Le¡ p be an odd prime such that p = kz -}-41 .Then any factor of l is a quadratic residue mod p.
Proof.It suffices to prove this for prime factors q of l.Now if q = 2, then p -1 mod 8, so 2 is a quadratic residue mod p.If q is odd, then p is a quadratic residue mod q and p z l is even, so that, by quadratic reciprocity, q is a quadratic residue mod p.
Note that it follows, by Theorem 2.1, that 72 -1 mod p if p or 25 mod 28.
We will devote the next section to a discussion of the Class II.At this point, we are content to remark Theorem 2.6.Suppose that b = residue t is basic mod b.
In the next section we generalize this obvious conclusion .

The class II situation
We define a function d from positive integers >_ 2 to non-negative integers by General Case Figure 1 p -5 mod 28 Special Case Figure 1 The tree provides the conceptual basis for the proof (see Theorem 3.2),that the primes p satisfying the congruence p -2dc + 1 mod 2d+iu constitute the totality of the primes p satisfying p -s mod 4t and d(p) = d.For we may argue by induction on d that there is only one residue class mod 2d+iu containing such primes .We assume n > m + 2 and we rewrite (3.4) as But it also shows that, if c(d + 1) is to be odd, to satisfy the inequality 1 <_ c(d + 1) _< 2u -1, and to render p = 1 -}-2d+lc(d -}-1) mod 2d+ 1 u equivalent to (3.16), then c(d+ 1) is determnnnd by c(d) -u) is odd and negative Thus, in any case, 2c(d+ 1) -c(d) mod u, so that, if 2d c(d) = 2n v mod u, then 2d+1c(d + 1) -2n.v mod u .This establishes the inductive step and also gives us a recurrente relation (3.17) for determining c(d).Of course, this recurrente relation is deducible from (3.18) 2c(d + 1) -c(d) mod u, which also shows why the period of c(d) is the order of 2 mod u.We emphasize that (3.17), together with the initial congruente c(m + 2) 2n -,-2 v mod u, gives a practical algorithm for determining the values c(d) -recall that c(d) is odd with 1 <_ c(d) <_ 2u -1 .We then apply Theorem 3.2 to determine the primes p in a given residue class mod 4t and satisfying d(p) = d.
Example 3.2.Let t = 11, s = 5, so that p -5 mod 44 .Thus To calculate c(d) we start the induction with c(2) -1 mod 11, so c(2) = 1 .Now l, the order of 2 mod 11, is 10, so the period of c(d) is 10, and (3 .17)yie1ds the table The tree diagram is shown in Figure 2.  Of course, the formal analysis for t = 12, say, is different from that for t = 3, but the conclusions are coextensive-and the same!Indeed, so far as the methods of this paper are concerned, we may really confine ourselves to the case that t is itself a prime.For it is trivial to derive the quadratic character of t from the quadratic characters of its prime factors; and our deductions are exclusively based on the quadratic character of t modulo the prime factors of b.Notice that we are far from saying that the basic character of t mod b can be deduced from that of the prime factors of t-just as we do not claim that, in general, the basic character of t mod b depends only on the equivalence class of t under the equivalente relation (4.1) .For example, 4 is basic mod 17 but 1 is not .It remains to make a remaxk if b is even.We do not attempt a careful analysis of this case, but we point out the following Proposition 4.1 .Leí t, b be mutually prime odd numbrs .Then the basic character of t mod b coincides with ¡he basic character of t mod 2b.
Proof.: Let the quasi-order of t mod b be n, and let tn = e mod b.Since t n -e is even, it follows that tn = e mod 2b.It next follows that n is the quasi-order of t mod 2b; for the quasi-order of t mod 2b is seen to be neither less than nor greater than the quasi-order of t mod b.This proves the proposition .
Finally, we analyse the basic character of t mod 2n, n >_ 2; of course, t is then odd .Theorem 4 .2 .Leí d(t) = q > 2. Then the quasi-order of t mod 2n is 2 n-9 if n > q.
Moreover, t is no¡ basic mod 2n .
Proof.We have t = 1 + c29 , with c odd .The conclusion is obvious if n <_ Let n > q.Now since it follows by an easy inductive argument on r that We can also handle the case q = 1 .Thus let us suppose d(t) = 1, so that t = 1 + 2c, with c odd .
Proof.. (i) is obvious .Thus we suppose n > q' .As before, we exploit the identity but now only for r >_ 2. For we deduce from (4.4) that t2 = 1 + 29 +lc", with c" odd.Thus and Theorem 4.3 .If t is given by (4 .4),with q' > 2, then (i) if n <_ q', the quasi-orden of t mod 2' is 1 and t is basic; (ii) if n > q', the quasi-orden of t mod 2n is 2n-9 and t is not basic.This shows that establishing the theorem .

Lemma 1 . 3 .
The residue t mod b is non-basic if t'n -1 mod b for some odd exponent m.

Theorem 2 . 3 .
Suppose that ¡he prime factors p of b are all such that (t, p) is in Class III.Then the residue t is not basic mod b.Proof.Let b = Ha y =1Pk¡, ki > 1.Then is odd and t P, 2 1 -1 mod pi .By Lemma 1 .5,t1 1Pk' -I -1 mod pi' .Set m = IIN 1(zl )Pk`-1.Then m is odd, and 1 mod pk`.

( 3 1
.1) d(n) = d !--1 2d 1 (n -1), 2d+1X(n -1).where (t, p) is in Class II.Then the Notice that, for an odd prime p, d(p) >_ 1 and that d(p) >_ 2 if (t, p) is in Class II.Let d be a fixed integer >_ 2 ; we then have the following theorem, generalizing Theorem 2.6. in this way, splitting the inequality d(p) > d into the two possibilities d(p) = d or d(p) > d + 1 .We demonstrate this tree in Figure

Figure 2
Figure 2 Notice that nót only does c(d) repeat from d = 12 onwards, but that the whole tree pattern repeats .
We conclude that 7 is not basic mod b if b is a product of primes p such that p -3,19 or 27 mod 28; and 7 is basic mod b if b is a product of primes p such that p -11,15 or 23 mod 28.
1 = -1 mod p It is then plain that t is a quadratic residue mod p if and only if t' is a quadratic residue mod p (where tt' and t, t' are both prime to p) .This shows that the class, in the sense of Section 2, to which (t, p) belongs depends only on the equivalente class of t.Thus our conclusions embodied in Theorems 2.3, 2 .4, 2 .6 and 3.1 apply to entire equivalence classes of integers t.Moreover, it follows that, insofar as we only exploit these results, we may assume that t is square-free .This has the important efect that, in applying the techniques of Section 3 to provide an explicit description of these primes p such that (t, p) is in class II and d(p) = d, we may, in practice, confine attention to m = 0 or 1 .