Section 16.5 Euler's Criterion
As it happens, Fact 16.4.5 is a terrible way to actually find quadratic residues for a given \(p\) in general, since it involves finding a primitive root and listing lots of powers. We need both theory and practice.
There is a much easier way. First recall our observation in Theorem 12.3.2:
We visualized it as the middle column in this graphic.
But as so often in mathematics, solving one question leads to another; after all, Theorem 12.3.2 didn't say when we got plus or minus 1, just that these are the only possibilities. Observe carefully above which rows start with the colors corresponding to squares (the column labeled 2), comparing them to whether the middle column is black or white.
Don't go on until you have tried this (interactively below, or even by hand with \(p=7\) or \(p=11\)). It's important to understood what is being asked before looking for patterns.
Hopefully you did notice a pattern. Let's formalize it as follows.
Theorem 16.5.2. Euler's Criterion.
If \(p\) is an odd prime, then for all integers \(a\) not a multiple of \(p\text{,}\) the sign of the following expression determines whether \(a\) is a QR.
We obtain \(+1\) if \(a\) is a QR, otherwise \(-1\text{.}\)
Proof.
Let \(g\) be a primitive root of \(p\text{,}\) so that \(a\equiv g^i\) for some \(i\text{.}\) Then if we let \(h=g^{(p-1)/2}\text{,}\) Fermat's Little Theorem shows that
Since \(g\) is a primitive root, \(h\equiv 1\) is impossible, so \(h\equiv -1\text{.}\) But then
This is \(+1\) when \(i\) is even and \(-1\) when \(i\) is odd. Finally, according to Fact 16.4.5, this is precisely when \(a\) is a quadratic residue and nonresidue, respectively.
Example 16.5.3.
This immediately gives the result in Fact 16.1.2 that \(-1\) has a square root modulo an odd prime \(p\) precisely when \(p\equiv 1\) (mod \(4\)), because \((-1)^{(p-1)/2}=+1\) precisely when \((p-1)/2\) is even, or \(p\equiv 1\) (mod \(4\)). That is much easier than our previous ad-hoc way of doing it!
We will now greatly amplify the power of our work thus far.