The set of primes of the form $a^2+8b^2$, where $a,b\in\mathbb N_+$

If we admit the result that an odd prime $p$ has the form $x^2+2y^2$ iff $p\equiv 1$ or $3$ modulo $8$ then the result follows, as $x^2+2y^2\equiv1\pmod 8$ if $y$ is even and $x^2+2y^2\equiv3\pmod 8$ if $y$ is odd. So $p=x^2+2(2z)^2$ iff $p\equiv1\pmod 8$.

The characterisation of primes of the form $x^2+2y^2$ follows standard methods in the theory of quadratic forms. Up to equivalence, $x^2+2y^2$ is the only positive definite integer form of discriminant $-8$, and a prime $p$ not dividing $-8$ is represented by some positive definite form of discriminant $-8$ iff $-8$ is a quadratic residue modulo $p$, etc.


We'll use that the ring $\mathbb Z[\sqrt{-2}]$ is a principal ideal domain.

A prime $p\equiv 1\pmod 8$ is of the form $a^2+2c^2$ if and only if $b$ is even. So primes of the form $a^2+8b^2$ are primes of the form $p=a^2+2c^2$ with the added condition that $p\equiv 1\pmod{8}$.

Now, if $p\equiv 1\pmod{8}$ then $n^2\equiv -2\pmod{p}$, for some $n$, so:

$$(n+\sqrt{-2})(n-\sqrt{-2})=p$$

Then let $a+c\sqrt{2}=\gcd(p,n+\sqrt{-2})$, where the GCD is taken in $\mathbb Z[\sqrt{-2}]$. Then $a^2+2c^2$ must be a divisor of $p^2$, but it cannot be $p^2$ (why?) and it cannot be $1$ (why?)