13. Quadratic Residues We now turn to the question of when a quadratic equation has a solution modulo m. The general quadratic equation looks like ax + bx + c 0 mod m. Assuming that m is odd or that b is even we can always comlete the square (the usual way) and so we are reduced to solving an equation of the form x a mod m. In fact, we are usually only interested in solving the equation modulo a rime, in which we are only missing the rime. Definition 13.1. We say a Z m is a quadratic residue of if a is a square modulo m, that is, the equation has a solution. x a mod m Theorem 13. (Euler s Criterion). Let be an odd rime. The congruence x a mod has a solution, that is, a is a quadratic residue of if and only if either divides a or a ( 1)/ 1. If a is not a quadratic residue then a ( 1)/ 1. Proof. If a then a 0 and 0 0 a mod, so that 0 is a quadratic residue of. Now suose that a is corime to. By assumtion there is an integer k such that k + 1. In this case If we ut then b a k b (a k ) a k a 1 k. 1 mod, by Fermat. Thus b is a solution of the equation x 1 mod, 1
so that b is a root of the olynomial x 1. As Z is a field, this olynomial has at most two roots. Now ±1 are two roots of this equation. It follows that b ±1 mod. Suose that a is a quadratic residue. Then c a mod for some integer c so that b a k (c ) k c 1 mod 1 mod, by Fermat. Thus a is a quadratic residue if and only if a is a root of the olynomial x k 1. This olynomial has at most k roots. But if a is corime to then the olynomial x a 0 mod, either has two solutions or no solutions. Thus recisely k residues classes are quadratic residues and so all of the roots of the olynomial x k 1 are quadratic residues. In fact it is ossible to write down, in some sense, the quadratic residues. Note that S { a Z k a k } is a comete residue system modulo. It follows that ±1 are the roots of x 1, ± are the roots of x, ±3 are the roots of x 3 and so on. It turns out to be very convenient to define a symbol which kees track of when a is a quadratic residue modulo a rime. Definition 13.3. Let be a rime and let a be an integer. We define the Legendre symbol by the rule: 0 if divides a. 1 if (a, ) 1 and a is a quadratic residue of. 1 if (a, ) 1 and a is not a quadratic residue of. Corollary 13.4. If is an odd rime and a Z then a ( 1)/ mod.
Proof. Immediate from (13.) and the definition of the Legendre symbol. Here are some of the key roerties of the Legendre symbol: Theorem 13.5. Let be an odd rime and let a and b be two integers. (1) If a b mod then (a ) ( ) b () If does not divide a then 1. (3) ( ) 1 ( 1) ( 1)/. Thus 1 is a quadratic residue if and only if 1 mod 4. (4) ( ) ( ) ( ) ab a b Proof. If a b mod then x a and x b have the same roots modulo. Thus (1) is clear. a is obviously a quadratic residue. Thus () is also clear. (13.) imlies that ( ) 1 ( 1) ( 1)/. If 4k + 1 then is even so that k, ( 1) ( 1)/ ( 1) k 1. Thus 1 is a quadratic residue of if 4k + 1. On the other hand, if 4k + 3 then k + 1, is odd so that ( 1) ( 1)/ ( 1) k+1 3 1.
Thus 1 is not a quadratic residue of if 4k + 3. This gives (3). If either a or b is a multile of then ab is also a multile of. Vice-versa, if ab is a multile of then one of a and b is a multile of. In this case b ( a ) ( ) b holds, as zero equals zero. Thus we may assume that a, b and ab are all corime to. In this case (a ) a ( 1)/ mod and Then This is (4). b (ab) ( 1)/ ( ) b b ( 1)/ mod. mod a ( 1)/ b ( 1)/ ( ) b mod. It seems worth ointing out that one case of (4) of (13.5) is straightforward. If a and b are quadratic residues then we may find α and β such that In this case α a mod and β b mod. (αβ) α β ab mod. Thus if a and b are quadratic residues then so is ab. In this case ( ) ( ) ( ) ab a b, holds as both sides are 1. Examle 13.6. Is 4 a quadratic residue modulo? We want to comute ( 4 4 ).
We have ( ) 4 ( ) ( 1 ) ( ) 3 ) ( ) 3 ( ( 1) 18 ( ) ( ) 3 We can also use ( ) ( ) 4 5 ( ) ( ) 1 5 ( ) 5 5