= Solution
The primes $2,5$ both work, with the zero residue as a solution. For every other prime, <multiplicativity of the Legendre symbol> and <quadratic reciprocity> give
$$
\left(\frac{10}p\right)=\left(\frac2p\right)\left(\frac5p\right)=(-1)^{(p^2-1)/8}\left(\frac p5\right).
$$
The first factor is positive for $p\equiv1,7\pmod8$; the second is positive for $p\equiv1,4\pmod5$. They must have the same sign. The <Chinese remainder theorem> therefore yields
$$
\boxed{p=2,5\quad\text{or}\quad p\equiv1,3,9,13,27,31,37,39\pmod{40}}.
$$
Back to article page