Can someone explain why $x^2 \equiv 2 \pmod{5}$ has no solution other than trial and error?
So I've shown that modulo 5, we have $0^2 \equiv 0, 1^2 \equiv 1, 2^2 \equiv 4, 3^2 \equiv 4, 4^2 \equiv 1$ and I'm seeing that it doesn't look like there is a solution but what is the actual reason? Since I can't go through infinitely many numbers.
Yes, because every integer is of one of the forms: $$5k,5k\pm1, 5k\pm2, k\in\Bbb Z$$ and we get:
$$(5k)^2=25k^2\equiv0\pmod5$$ $$(5k\pm1)^2=25k^2\pm10k+1\equiv1\pmod5$$ $$(5k\pm2)^2=25k^2\pm20k+4\equiv4\pmod5$$
None of these are $\equiv2\pmod5$, so no solutions exist