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?