For which prime numbers $p$ there exist $x,y\in \Bbb{Z}$ such that $p=x^2+2y^2$?

208 Views Asked by At

For which prime numbers $p$ there exists $x,y\in \Bbb{Z}$ such that $p=x^2+2y^2$? I guess I am to use continued fraction, but I am not sure how. I know how to find solutions for defined numbers but I can't find sets of $p$ that satisfy the above. It will be much appreciated if you have any lead or hint as for how to do it.