For an odd prime number , the Legendre symbol is zero when , one when is a nonzero quadratic residue modulo , and minus one otherwise. The number-theoretic Gauss lemma says that, for , , where counts those least positive residues of exceeding .
For , the residues are simply , so . Examining the four odd residue classes modulo eight gives
Now and is odd. The multiplicative order of divides but not . Since is a power of two, every proper divisor of divides , whence . Lagrange's theorem for finite groups gives . Because , this implies , so the supplementary law just proved gives . By Euler's criterion, , and consequently . Therefore
For an odd prime , the Legendre symbol is
Euler criterion states that
The Gauss lemma says that, for , if of the least positive residues of
lie in , then
To prove it, replace every residue above by its negative. The resulting absolute residues are distinct up to sign and therefore form a permutation of
Multiplying the congruences gives
Cancel the nonzero factorial and apply Euler's criterion.
For , the residues are . The number above is
whose parity gives the second supplementary law for quadratic reciprocity
Consequently, for odd primes,
The congruence is also soluble for .