THE JACOBI SYMBOL AND A METHOD OF EISENSTEIN FOR CALCULATING IT STEVEN H. WEINTRAUB ABSTRACT. We present an exposition of the asic properties of the Jacoi symol, with a method of calculating it due to Eisenstein. Fix a prime p. For an integer a relatively prime to p the Legendre symol is defined y a/p 1 if a is a quadratic residue mod p and a/p 1 if a is a quadratic nonresidue mod p. We recall Euler s theorem that a/p a p 1/ mod p. We have the famous Law of Quadratic Reciprocity: Theorem 1. The Law of Quadratic Reciprocity Let p and q e distinct odd primes. Then p q 1 p 1 q 1. q p We also recall the following, where a follows directly from Euler s theorem and follows directly from Gauss s Lemma. Theorem. Supplement to the Law of Quadratic Reciprocity Let p e an odd prime. Then 1 1 1 p 1 p 1 if p 1mod4 and 1 if p 1mod4, 1 p 1 p 1 if p ±1mod and 1 if p ±3mod. We often regard these results as providing a method for calculating Legendre symols. 000 Mathematics Suject Classification. 11A15, Secondary 01A55. Key words and phrases. Quadratic reciprocity, Jacoi symol, Eisenstein. 1
STEVEN H. WEINTRAUB Example 3. We wish to calculate 4661/9901. We have: 4661 59 79 9901 9901 9901 9901 9901 9901 4 6 3 13 79 1 +1 3 13 1 1 +1 3 13 1 1+1+1 1. Note the first step in this example required us to factor 4661. In general, factorization is difficult, so this is not an effective method for calculating Legendre symols. We now introduce Jacoi symols, which generalize Legendre symols. In addition to their own intrinsic interest, they enale us to compute Legendre symols without having to factor integers. Definition 4. Let e a positive odd integer, and suppose that 1 l, a product of not necessarily distinct primes. For an integer a relatively prime to, the Jacoi symol a/ is defined to e the product a a a. 1 l If 1, then a/ 1. We now derive asic properties of the Jacoi symol. First, we need a lemma from elementary numer theory. Lemma 5. Let u and v e odd integers. Then uv 1 u 1 + v 1 and uv 1 Proof. We simply calculate [ uv 1 u 1 which is always even, and similarly uv [ 1 u 1 + v 1 which is also always even. u 1 + v 1 mod mod. + v 1 ] uv u v+1 ] uv u v + 1 u 1v 1, u 1v 1,
THE JACOBI SYMBOL AND A METHOD OF EISENSTEIN FOR CALCULATING IT 3 Theorem 6. Properties of the Jacoi symol 1 If is a prime, the Jacoi symol a/ is the Legendre symol a/. If a/ 1, then a is not a quadratic residue mod. The converse need not hold if is not a prime. 3 aa / a/a/ a /a / if aa and are relatively prime. 4 a / a/ 1 if a and are relatively prime. 5 1/ 1 1 1 if 1mod4 and 1 if 1mod4. 6 / 1 1 1 if ±1mod and 1 if ±3mod. 7 If a and are relatively prime odd positive integers, then a 1 a 1 1. a Proof. Parts 1 through 4 are straightforward. We prove part 5 y induction on the numer of prime factors l of. The critical case is l. Thus let 1, with 1 and each prime. In this case the left-hand side is 1 1 1 while the right-hand side is 1 1 1 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 and these are equal. We prove part 6 similarly. Again let 1, with 1 and each prime. In this case the left-hand side is 1 while the right-hand side is 1 1 1 1 1 1 1 1 + 1 1 1 1 1 1 1 and these are equal. For part 7, let a a 1 a k and 1 l. Then, y the Law of Quadratic Reciprocity, with ε i, j a i 1 i 1 a a. But then i, j a i 1 ε i 1 i, j [ ] a 1 j 1 j [ ] a 1 ai j j a i 1 a i 1 i 1 1 ε i, j [ j j 1 j i ] a i 1 j 1 [ ][ a 1 1 ] mod.
4 STEVEN H. WEINTRAUB Theorem 7. Let a and e relatively prime odd positive integers. 1 If ε ±1, then εa 1 εa 1 1. a If ε 1 ±1 and ε ±1, then ε1 a ε 1 ε 1 a 1 ε 1 + ε 1 1 ε 1. a Proof. 1 If ε 1 there is nothing more to prove. Let ε 1. Then εa a 1 a a a a where x 1 + a 1 1 a+1 On the other hand, in this case, 1 1 1 a 1 1 1 x 1. 1 εa 1 1 1 a 1 1 1 y where y a 1 1 a+1 1 x, and y xmod. The only new case here is ε 1 ε 1, so suppose that is the case. Then the left-hand side is a 1 1 a a a a where, setting u a 1 and v 1, x uv+u+v. In this case the right-hand side is 1 a 1 1 1 1 a 1 1 1 x, 1 a 1 1 + 1 1 1 a+1 +1 +1 1 y, where y u+1v+1+1 uv+u+v+, and y xmod. Remark. It is convenient to oserve here that if ε ±1, then ε 1 ε 1 1. If ε 1 this is 1/ 1, which is trivial, and if ε 1 this is 1/ 1 1, which we know.
THE JACOBI SYMBOL AND A METHOD OF EISENSTEIN FOR CALCULATING IT 5 We now come to Eisenstein s method of computing Jacoi symols. Theorem 9. Eisenstein [1] Let e a positive odd integer and let a e an aritrary odd integer. Set a 1 a, a, and then a 1 q 1 a + ε 1 a q + ε a 4... a n q n a n+1 + ε n a n+ with a > >... > a n+ 1, all a i odd, and ε i ±1 for each i. For each i 1,...,n, let so Let t n i1 s i. Then s i 0 if at least one of a i+1 and ε i a i+ 1mod4, 1 if oth of a i+1 and ε i a i+ 3mod4. Proof. We have a/ a 1 /a. Now a1 ε1 a a a ε a 4 an a n+1 a n+1 a 1 t. 1 ε 1 1 1 ε a 4 1 a 1 a3 1 a a3 a 4 1 s 1 1 s... εn a n+ 1 εna n+ 1 an+1 1 1 s n a n i1 1 s i 1 n i1 s i 1 t. a a3 Actually, it is not necessary to carry the computation all the way to the end. Corollary 10. In the situation of the aove theorem, let t k k i1 s i. Then for any k n a 1 t ak+1 k. Proof. Exactly the same. Example 11. We present several typical computations. The first is Eisenstein s illustration of his method. 1 We compute 773/343. a k+ 773 343+7 so s 1 1 343 4 7 5 so s 1 7 1 5 3 so s 3 0 5 3 1 so s 4 1 Hence 773 1 3 1. 343 a 4
6 STEVEN H. WEINTRAUB We compute 4661/9901. 4661 0 9901+9901 so s 1 0 9901 4661+579 so s 0 4661 579+9 so s 3 0 579 0 9 1 so s 4 0 Hence 4661 1 0 1. 9901 3 We compute 10399/341. 10399 4 341+1035 so s 1 0 341 1035+71 so s 1 1035 4 71 49 so s 3 1 Hence 10399 49 1 1 341 a 6 as 49 7. Remark 1. We may speed up Eisenstein s algorithm. Suppose that we are using this algorithm and at some stage we arrive at a i /a i+1. Write a i q i a i+1 + ε i e ia i+ where ε i ±1, e i > 0, e ia i+ < a i+1, and a i+ is a positive odd numer. Then a i/a i+1 e i/a i+1 ε i a i+ /a i+1, and the first factor is easy to compute. Note that a i+ < 1 a i+1. Hence we see that this modified algorithm reduces the denominator of the Jacoi symol y a factor of at least every step, ensuring that it ends quickly. It turns out that sometimes the choice of odd remainder leads to the smaller value of a i+, and sometimes the choice of even remainder does, so the most efficient way to proceed is to choose whichever one yields the smaller value. We thus otain the following modified algorithm: Theorem 13. Let a and e odd integers with > 0. Set a 1 a, a, and then, assuming that a i and a i+1 are defined, set with a i+ ε i ±1. a i q ia i+1 + ε i a i+, a i q i a i+1 + ε i e i a i+ and a i+ positive odd integers, e i > 0, a i+ < a i+1, e ia i+ < a i+1, ε i ±1, and If a i+ a i+, set a i+ a i+, ε i ε i, and r i 0. If a i+ < a i+, set a i+ a i+, ε i ε i, and set r i 0 if e i is even or a i+1 ±1 mod and r i 1 if e i is odd and a i+1 ±3 mod. Set s i 0 if at least one of a i+1 and ε i a i+ 1mod4, and s i 1 if oth of a i+1 and ε i a i+ 3mod4. Let u k k i1 r i + s i. Then a1 a 1 u k ak+1 a k+.
THE JACOBI SYMBOL AND A METHOD OF EISENSTEIN FOR CALCULATING IT 7 In particular, if a n+ 1, a1 a 1 u n. Example 14. The computation of 3767/9999 y Eisenstein s original algorithm takes 3 steps. We compute 3767/9999 using this faster algorithm. 3767 0 9999+3767 so r 1 0, s 1 0 9999 3 3767+ 3 11 so r 0, s 1 3767 155 11+ 31 so r 3 1, s 3 1 11 7 31 3 so s 4 0, r 4 0 31 10 3+1 so r 5 0, s 5 0 Hence 3767 1 3 1. 9999 Remark 15. Of course, any valid computation with Legendre symols is also a valid computation with Jacoi symols. REFERENCES [1] G. Eisenstein, Einfacher Algorithmus zur Bestimmung des Werthes von a/, J. reine angew. Math. 7 144, 317-31. DEPARTMENT OF MATHEMATICS, LEHIGH UNIVERSITY, BETHLEHEM, PA 1015-3174, USA E-mail address: shw@lehigh.edu