# Is $\left(\frac{a^2}{5}\right)=1$ for all $a$ not divisible by 5?

Note $$\left(\frac{a^2}{5}\right)$$ is the Legendre symbol.

I used wolfram alpha to see if, $$\left(\frac{a^2}{5}\right) = 1$$ and this is true for integers from $$1$$ to $$10$$ and it is except $$5$$ and $$10$$, which are divisible by $$5$$. So is this true in general for any $$a$$ not divisible by 5?

• @zaira That is simply the definition of the symbol. May 1, 2022 at 17:22
• If you base it off the definition $\Big(\frac{a}{p}\Big) = a^{\frac{p-1}{2}}$ mod $p$, then the result follows immediately from Fermat's Little Theorem. May 1, 2022 at 17:23
• The legendre symbol is multiplicative in the upper entry, so yes! May 1, 2022 at 17:29

The expression $$\left(\frac{a^2}{5}\right)$$ asks if there exists a natural number $$x$$ such that $$x^2\equiv a^2 \bmod 5,$$ from the definition of the Legendre Symbol. You simply let $$x=a$$ to satisfy the equation, so such an $$x$$ does exist, that is why Wolfram-Alpha returned a $$1$$ for this Legendre Symbol.
When $$5 \mid x$$, it is clear that $$5 \mid a^2$$, so the Legendre gives $$0$$ by definition.
Euler's criterion tells us that the Legendre symbol is $$\big(\dfrac {a^2}5\big)=(a^2)^\frac{5-1}2\equiv (a^2)^2\equiv a^4\equiv 1\pmod 5,$$ by Fermat's little theorem.
This is true whenever $$(a,5)=1.$$
Alternatively $$\big(\dfrac {a^2}5\big) =\big(\dfrac a5\big) ^2=1.$$