Let $p$ be a prime number $(p \neq 2$ and $p \neq5)$, and let $A$ be some given number. Suppose that $p$ divides the number $A^2 - 5$. Show that $p$ must be congruent to either 1 or 4 modulo 5.
A little confused about this number theory question. Any Help? I would love to see a solution to this problem. Thanks.
Since $p|A^2-5$, we can say $A^2\equiv 5\pmod{p}$. That means $5$ is a quadratic residue, modulo $p$, or in terms of the Legendre symbol, that $\left(\frac{5}{p}\right)=1$. Since $5$ is congruent to $1$ modulo $4$, we know from quadratic reciprocity that $\left(\frac{5}{p}\right)=\left(\frac{p}{5}\right)$. From here, it's just a matter of verifying that quadratic residues modulo $5$ are all congruent to $1$ or $4$.