Quadratic Residues 4--015 a is a quadratic residue mod m if x = a (mod m). Otherwise, a is a quadratic nonresidue. Quadratic Recirocity relates the solvability of the congruence x = (mod q) to the solvability of the congruence x = q (mod ), where and q are distinct odd rimes. If is an odd rime, there are equal numbers of quadratic residues and quadratic nonresidues among {1,,..., 1}. If is an odd rime, a > 0, and (a,) = 1, the Legendre symbol a is defined by a { 1 if a is a quadratic residue mod = 1 if a is a quadratic nonresidue mod. Legendre symbols rovide a comutational tool for determining whether a quadratic congruence has a solution. Euler s theorem says that if is an odd rime, a > 0, and (a,) = 1, then a = a ( 1)/ (mod ). Gauss considered the roofs he gave of quadratic recirocity one of his crowning achievements; in fact, he gave 6 distinct roofs during his lifetime. Recirocity is a dee result: Proofs eluded both Euler and Legendre. The recirocitylaw is simle to state. Forand q odd rimes, it relatessolutions to the two congruences x = (mod q) and x = q (mod ). (Note how and q switch laces: This exlains why it s called a recirocity law.) The law of quadratic recirocity says: The congruences are either both solvable or both unsolvable, unless both rimes are congruent to 3 mod 4. In that case, one is solvable while the other is not. Gauss first gave a roof of this when he was 19! Gauss s masterwork, the Disquisitiones Arithmeticae, was ublished in 1801 when Gauss was 4. It changed the course of number theory, collecting scattered results into a unified theory. Definition. Let (a,m) = 1, m > 0. a is a quadratic residue mod m if the following equation has a solution: x = a (mod m). Otherwise, a is a quadratic nonresidue mod m. Examle. 8 is a quadratic residue mod 17, since 5 = 8 (mod 17). 1
However, 8 is a quadratic nonresidue mod 11, because x = 8 (mod 11) has no solutions. n 0 1 3 4 5 6 7 8 9 10 n (mod 11) 0 1 4 9 5 3 3 5 9 4 1 As the table shows, 1, 3, 4, 5, and 9 are quadratic residues mod 11. (0 is not considered a quadratic residue, since (0,11) = 11 1.) But 8 is a quadratic nonresidue mod 11. Notice the symmetry in the nonzero elements of the table. Do you see why this is haening? Lemma. Let be an odd rime. The congruence has: (a) Only the solution x = 0 if a = 0. (b) Exactly 0 or solutions if a. x = a (mod ) Proof. x = 0 solves x = 0 (mod ). Conversely, if x = 0 (mod ), then x, so x, and hence x = 0 (mod ). Suose a. To show there are 0 or solutions, suose there is at least one solution b. Then b = a (mod ), so ( b) = a (mod ). I claim that b and b are distinct. If not, then b = b (mod ), so b. is an odd rime, so. Therefore, b, b = 0 (mod ), b = 0 (mod ), and finally a = 0 (mod ) contradicting a. Hence, b b (mod ). Now I have two distinct solutions; since a quadratic equation mod has at most two solutions (Prove it!), there are exactly two. Examle. x = 8 (mod 17) has 5 and 1 as solutions, and 5 = 1 (mod 17). But note that the result is false if = : x = 1 (mod ) has exactly one solution (x = 1 (mod )). Corollary. Let be an odd rime. There are 1 in {1,..., 1}. quadratic residues and 1 quadratic nonresidues mod Proof. k and k = k have the same square mod. That is, 1 and 1 have the same square, and have the same square,..., and 1 and 1 +1 have the same square. Thus, the number of different squares is 1 these squares are the quadratic residues, and the other 1 numbers in {1,,..., 1} are quadratic nonresidues. The fact observed in the first sentence of the roof exlains the symmetries in the table of squares mod 11 and mod 7 that I gave above. Definition. Let be an odd rime, and let (a,) = 1. The Legendre symbol a is defined by a { 1 if a is a quadratic residue mod = 1 if a is a quadratic nonresidue mod Note that a = 0 is disallowed (since (0,) = 1) even though x = 0 (mod ) has a solution.
Examle. (5,11) = 1. 5 = 1, since 4 = 5 (mod 11). Likewise, 11 = 1, since 6 = 11 (mod 5). 11 5 Note that 5 is congruent to 1 mod 4; as redicted by recirocity, both of the following the congruences have solutions: x = 5 (mod 11) and x = 11 (mod 5). You might wonder about the case where =, or the case where the modulus is comosite. For =, there are only two quadratic congruences: x = 0 (mod ) and x = 1 (mod ). These have the solutions x = 0 (mod ) and x = 1 (mod ) nothing much is going on. If the modulus has rime factorization n = r1 1 r k k, then relative rimality imlies that it s enough to solve the congruences x = a (mod ri i ) for each i. It turns out that solving such a congruence reduces to determining whether a is a quadratic residue mod i. Therefore, there is little harm in concentrating on the case of a single rime. Examle. Solve the congruence I ll solve the congruences x = 79 (mod 91). x = 79 (mod 7) and x = 79 (mod 13). x = 79 (mod 7) reduces to x = (mod 7). Making a table of squares mod 7, I find that the solutions are x = 3 and x = 4 mod 7. x = 79 (mod 13) reduces to x = 1 (mod 13). The solutions are x = 1 and x = 1 = 1 mod 13. I ll consider the = 4 ossibilities, solving using the Chinese Remainder Theorem. But note that since m = ( m), the solutions will come in airs. So once I find a solution m, I know that m is also a solution. Consider x = 3 (mod 7) x = 1 (mod 13) m 7 13 13 7 s = 1 (mod m) 6 a 3 1 x = 13 6 3+7 1 = 48 = 66 (mod 91). Then x = 66 = 5 (mod 91) is another solution. Consider x = 3 (mod 7) x = 1 (mod 13) m 7 13 13 7 s = 1 (mod m) 6 a 3 1 3
x = 13 6 3+7 1 = 40 = 38 (mod 91). Then x = 38 = 53 (mod 91) is another solution. It s ossible that the second comutation might have given me 5, the solution I got earlier. In that case, I d have to move on to one of the other two cases. I got lucky and had to only do two cases, instead of three. Here are some tools for comuting Legendre symbols. Theorem. (Euler) Let be an odd rime, a > 0, (a,) = 1. Then a = a ( 1)/ (mod ). Proof. There are two cases. Suose that a = 1. Then there is a number b such that b = a (mod ). So (b ) ( 1)/ = a ( 1)/ (mod ) b 1 = a ( 1)/ (mod ) If b, then b = a, a contradiction. So b, and Fermat s theorem imlies that b 1 = 1 (mod ). So a ( 1)/ = 1 (mod ), and a = a ( 1)/ (mod ). The other ossibility is a = 1. In this case, consider the set {1,,..., 1}. I claim that these integers occur in airs s, t, such that st = a. First, if s {1,,..., 1}, then s is invertible mod. So I can write s(s 1 a) = a, and the air s, s 1 a, multilies to a. Moreover, s and s 1 a are distinct. If not, s = s 1 a, or s = a, which contradicts a = 1. Since the integers {1,,..., 1} divide u into airs, each multilying to a, and since there are 1 airs, I have 1 ( 1) = a ( 1)/ (mod ). By Wilson s theorem, 1 = a ( 1)/ (mod ) a = a ( 1)/ (mod ) Examle. Suose = 13 and a = 10. Then a ( 1)/ = 10 6 = 1 (mod 13). Hence, 10 = 1, and x = 10 (mod 13) should have a solution. Indeed, 13 7 = 49 = 10 (mod 13). 4
Lemma. If a = b (mod ), then a = b Proof. If a = b (mod ), then x = a (mod ) if and only if x = b (mod ). Thus, one of these equations is solvable or not solvable if and only if the same is true for the other which means a = b Note that I can use this result to aly Euler s formula to a for a < 0 by simly relacing a with b > 0 such that a = b (mod ). Lemma. Let be an odd rime, a,b > 0, (a,) = (b,) = 1. Then a b = ab Proof. By Euler, a b = a ( 1)/ b ( 1)/ (mod ), and ab = (ab) ( 1)/ (mod ). Therefore, a b = ab (mod ). The two sides of this equation are ±1. Since is an odd rime, the two sides can t differ by. Hence, they must be equal as integers: a b = ab Corollary. Let be an odd rime, a > 0, (a,) = 1. Then a = 1. You can use the results above to comute a for secific values of a and arbitrary. Lemma. { 1 1 if = 4k+1 = 1 if = 4k + 3. Proof. By Euler s formula, 1 = 1 = ( 1) ( 1)/ = ( 1) ( 1)/ = { { ( 1) k if = 4k +1 1 if = 4k +1 ( 1) k+1 if = 4k + 3 = 1 if = 4k + 3. Using Gauss s lemma, which I ll rove shortly, you can also show that = ( 1) ( 1)/8. Note that the exonent on the right is actually an integer: Since = k +1, 1 = 4k(k +1). And 4k(k +1) is divisible by 8, because one of k, k +1, must be even. 5
Examle. 1 = 1, because 13 = 4 3+1. Thus, x = 1 (mod 13) has solutions. And in fact, 13 5 = 5 = 1 = 1 (mod 13). Likewise, 1 = 1, because 3 = 4 5+3. Hence, x = 1 (mod 3) has no solutions. 3 Finally, = ( 1) (7 1)/8 = 1. 7 Therefore, x = (mod 7) has solutions. x = 3 works, for instance. c 015 by Bruce Ikenaga 6