No integers satisfying $x^2+2y^2 = p$

766 Views Asked by At

Suppose $p$ is a prime such that $p \equiv 5,7\ (\text{mod}\ 8)$ then I want to show that there exist no integral solutions $(x,y)$ such that $x^2+2y^2 = p$.

My idea was to look at the equation modulo $2$. We get $x^2 \equiv 1 (\text{mod}\ 2)$. But this has solutions for $x \in \mathbb{Z}$.

Then what am I missing? or is the statement false?

2

There are 2 best solutions below

1
On BEST ANSWER

From $x^2\equiv 1\pmod{2}$. You got that $x$ has to be odd. You have two options:

$x,y$ odd. Then $x^2+2y^2\equiv 1+2=3\pmod{8}$.

$x$ odd, $y$ even. Then $x^2+2y^2\equiv 1+0=1\pmod{8}$.

And you are done.

0
On

Another approach is simply to compute $x^2+2y^2 \bmod 8$ for $x,y =0, \dots 7$. The result is $0, 1, 2, 3, 4, 6$. Therefore, if $z \equiv 5,7 \bmod 8$, then $z$ is not of the form $x^2+2y^2$. This has nothing to do with $z$ being prime or not.