10

Show that $x^2+2y^2=p$ has a solution in $\mathbb{Z}\;$ if and only if $\;p \equiv 1 \; \text{or} \; 3 \mod 8$.

Can someone help on this. Thnx.

amWhy
  • 209,954
Vali
  • 101

1 Answers1

7

One direction: if $x^2+2y^2=p$ then $x^2\equiv -2y^2\pmod{p}$. But $\gcd(y,p)=1$ so $(x/y)^2\equiv -2\pmod{p}$. Hence $1=\left(\frac{-2}{p}\right)=\left(\frac{2}{p}\right)\left(\frac{-1}{p}\right)=(-1)^{\frac{(p+1)(p-1)}{8}}(-1)^{\frac{p-1}{2}}$ which implies $p\equiv 1,3\pmod{8}$.

vadim123
  • 82,796