For which primes $p\not=2$ is $5$ a square mod $p$?

1.2k Views Asked by At

For which primes $p\not=2$ is $5$ a square mod $p$?


Using the Legendre symbol, $5$ is a square modulo $p$ if

$$\left(\frac{5}{p}\right)=5^{\dfrac{p-1}{2}} \equiv 1 \pmod{p}$$

Now we have

$$5^{\dfrac{p-1}{2}} = (5^{p-1})^{1/2} \equiv 1\pmod{p}$$

So $5$ is a square for any $p$. But this doesn't seem correct to me. Can anyone check this and if it's wrong, explain why.

2

There are 2 best solutions below

7
On BEST ANSWER

You can't take the square root like this. By Fermat's little theorem, we know that for $p$ prime we have that $5^{p-1} \equiv 1 \mod p$. This means that $p \mid 5^{p-1} -1$, and hence $$p \mid \left(5^{\tfrac{p-1}{2}} -1\right)\left(5^{\tfrac{p-1}{2}} +1\right)$$

Therefore $5^{\tfrac{p-1}{2}} \equiv 1 \mod p$ or $5^{\tfrac{p-1}{2}} \equiv -1 \mod p$.

Note that if $p$ is not prime, there can be even more possibilities.


Note that for every odd prime $p$ we have $2 \mid p-1$. Also $4 \mid 5-1$. So $2 \mid \left(\frac{p-1}{2} \cdot \frac{5-1}{2} \right)$. Hence by quadratic reciprocity we have $$\left( \frac{p}{5} \right)\left( \frac{5}{p} \right) = (-1)^{\frac{p-1}{2} \cdot \frac{5-1}{2}} = 1$$

So $\left( \frac{p}{5} \right) =1$ if $\left( \frac{5}{p} \right)=1$, and the latter happens when $p\equiv 1 \mod 5$ or $p \equiv 4 \mod 5$.

Note that one can not use the law if $p=5$, since the law of quadratic reciprocity requires $p$ and $q$ to be different primes. Whether $p=5$ is a quadratic residue depends on the definition of quadratic residue.

4
On

The number $5$ is a square modulo the prime $5$, though I would not call it a quadratic residue of $5$. Now assume that $p$ is an odd prime other than $5$.

By Quadratic Reciprocity, since $5$ is of the form $4k+1$, we have $(5/p)=(p/5)$.

Note that $(p/5)=(r/5)$, where $r$ is the remainder when we divide $p$ by $5$.

It is easy to check that $1$ and $4$ are quadratic residues of $5$, and $2$ and $3$ are not.

Thus $(5/p)=1$ if and only if the odd prime $p$ is congruent to $1$ or $4$ modulo $5$. Equivalently, $(5/p)=1$ if and only if the rightmost decimal digit of the prime $p$ is $1$ or $9$.