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?

  • 4
    $\begingroup$ @zaira That is simply the definition of the symbol. $\endgroup$
    – egglog
    May 1, 2022 at 17:22
  • 4
    $\begingroup$ 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. $\endgroup$
    – egglog
    May 1, 2022 at 17:23
  • 5
    $\begingroup$ The legendre symbol is multiplicative in the upper entry, so yes! $\endgroup$
    – Lubin
    May 1, 2022 at 17:29

1 Answer 1


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.

  • 1
    $\begingroup$ nice answer ........ +1 $\endgroup$
    – TShiong
    Apr 30 at 20:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .