I'd really love your help with showing that for every prime $p>7$, there are integers $x,y$ such that $p=x^2+7y^2$, if and only if, $p \equiv 1,2,4 \pmod7$.
$x^2+7y^2$ is the norm of the Euclidean domain $a+b\sqrt{-7}$ and $p$ is composite in the domain iff it is a norm, i.e $x^2+7y^2=1$ (I'm not sure I need this now).
as well the squares$\pmod7$ (The numbers that left the same residue after squaring) are $0,1$ so I guess $x^2+y^2 \equiv 0,1,2 \pmod7$, Is this correct? How should I go on?
Thanks a lot!