= Solution
Because $p$ is odd, $x$ must be odd. Every odd square is $1$ modulo eight. If $y$ is even, $2y^2$ is zero modulo eight; if $y$ is odd, it is two modulo eight. Thus
$$
\boxed{p\equiv1\text{ or }3\pmod8.}
$$
More precisely, the first case has even $y$ and the second has odd $y$. These are necessary conditions on the <congruence class>, as requested; the elementary calculation alone does not prove their sufficiency.
Equivalently, reduction modulo $p$ makes $-2$ a <quadratic residue>: $p$ cannot divide $y$, since that would also force $p\mid x$ and hence $p^2\mid p$. The two supplementary laws and <multiplicativity of the Legendre symbol> give the same two allowed classes.
Back to article page