next up previous
Next: The Quadratic Reciprocity Law Up: Lecture 12: Quadratic Reciprocity Previous: Lecture 12: Quadratic Reciprocity

Euler's Criterion

Proposition 1.1 (Euler's Criterion)   Let $ p$ be an odd prime and $ a$ an integer not divisible by $ p$. Then $ x^2\equiv a\pmod{p}$ has a solution if and only if

$\displaystyle a^{(p-1)/2}\equiv 1\pmod{p}.
$

Proof. By the theorem from Lecture 11, there is an integer $ g$ that has order $ p-1$ modulo $ p$. Every integer coprime to $ p$ is congruent to a power of $ g$. First suppose that $ a$ is congruent to a perfect square modulo $ p$, so

$\displaystyle a\equiv (g^r)^2 \equiv g^{2r}\pmod{p}
$

for some $ r$. Then

$\displaystyle a^{(p-1)/2} \equiv g^{2r\cdot\frac{p-1}{2}} \equiv
g^{r(p-1)}\equiv 1\pmod{p}.
$

Conversely, suppose that $ a^{(p-1)/2}\equiv 1\pmod{p}$. We have $ a\equiv g^r \pmod{p}$ for some integer $ r$. Thus $ g^{r(p-1)/2}\equiv 1\pmod{p}$, so

$\displaystyle p-1 \mid r(p-1)/2
$

which implies that $ r$ is even. Thus $ a\equiv (g^{r/2})^2\pmod{p}$, so $ a$ is congruent to a square modulo $ p$. $ \qedsymbol$

Corollary 1.2   If $ x^2\equiv a\pmod{p}$ has no solutions if and only if $ a^{(p-1)/2}\equiv
-1\pmod{p}$.

Proof. This follows from Proposition 1.1 and that the polynomial $ x^2-1$ has no roots besides $ +1$ and $ -1$. $ \qedsymbol$

Example 1.3   Suppose $ p=11$. By squaring each element of $ (\mathbb{Z}/11\mathbb{Z})^*$, we see exactly which numbers are squares modulo $ 11$:

$\displaystyle 1^2 = 1,\, 2^2 = 4,\, 3^2 = 9,\, 4^2 = 5,\, 5^2 = 3,\, 6^2 = 3,\,
7^2 = 5,\, 8^2 = 9,\, 9^2 = 4,\, 10^2 = 1.
$

Thus the squares are $ \{1,3,4,5,9\}$. Next, we compute $ a^{(p-1)/2}=a^{5}$ for each $ a\in(\mathbb{Z}/11\mathbb{Z})^*$.

$\displaystyle 1^{5} = 1,\, 2^{5} = -1,\, 3^{5} = 1,\, 4^{5} = 1,\, 5^{5} = 1,\,
6^{5} = -1,\, 7^{5} = -1,\, 8^{5} = -1,\, 9^{5} = 1,\, 10^{5} = -1.
$

The $ a$ with $ a^5=1$ are $ \{1,3,4,5,9\}$, which is exactly the same as the set of squares, just as Proposition 1.1 predicts.

Example 1.4   Determine whether or not $ 3$ is a square modulo $ p=726377359$.
Answer: We compute $ 3^{(p-1)/2}$ modulo $ p$ using PARI:
? Mod(3,p)^((p-1)/2)
%5 = Mod(726377358, 726377359)   \\ class of -1 modulo 726377359.
Thus $ 3$ is not a square modulo $ p$. This computation wasn't too difficult, but it would have been very tedious to carry about by hand. The law of quadratic reciprocity, which we will state in the next section, is a vastly more powerful way to answer such questions. For example, you could easily answer the above question by hand using quadratic reciprocity.

Remark 1.5   Proposition 1.1 can be reformulated in more group-theoretic language as follows. The map

$\displaystyle (\mathbb{Z}/p\mathbb{Z})^* \rightarrow \{\pm 1\}
$

that sends $ a$ to $ a^{(p-1)/2}\pmod{p}$ is a homomorphism of groups, whose kernel is the subgroup of squares of elements of $ (\mathbb{Z}/p\mathbb{Z})^*$.

Definition 1.6   An element $ a\in\mathbb{Z}$ with $ p\nmid a$ is called a quadratic residue modulo $ p$ if $ a$ is a square modulo $ p$.


next up previous
Next: The Quadratic Reciprocity Law Up: Lecture 12: Quadratic Reciprocity Previous: Lecture 12: Quadratic Reciprocity
William A Stein 2001-10-06