The squares modulo 8 are 1, 4, 1, 0, 1, 4, 1, 0 and twice the squares modulo 8 are 2, 0, 2, 0, 2, 0, 2, 0. Therefore, $x^2 + 2y^2 \equiv 0, 1, 2, 3, 4$ or $6 \pmod 8$. So if a prime $p \equiv 5$ or $7 \pmod 8$ then it can't be of the form $x^2 + 2y^2$.
So far I have only used elementary methods, and maybe the rest of what I'm thinking can be accomplished without recourse to algebraic number theory. But since you tagged this question with that tag, I will go ahead and avail myself to the methods of algebraic number theory. I don't know how much you know about it, and I certainly can't claim to be an expert. Please bear me with me if I seem to be repeating basic facts you already know.
If $a$ and $b$ are integers in the usual sense, then $$(a - b\sqrt{-2})(a + b\sqrt{-2}) = a^2 + 2b^2.$$ Essentially we have computed the algebraic norm of $a \pm b\sqrt{-2}$, both of which are algebraic integers in the ring $\mathbb{Z}[\sqrt{-2}]$, and their product (this norm) is an integer in the usual sense (a whole, purely real rational number). All numbers in $\mathbb{Z}[\sqrt{-2}]$ are of the same form as $a \pm b\sqrt{-2}$, and the product of any numbers in this ring is also a number in this ring, which is another way of saying this ring is closed under multiplication.
Since $b$ can be 0, all purely real rational integers (notated $\mathbb{Z}$ or $\textbf{Z}$) are in this ring. But certain prime numbers from $\mathbb{Z}$ are "composite" in $\mathbb{Z}[\sqrt{-2}]$:
- $2 = (-1)(\sqrt{-2})^2$
- $3 = (1 - \sqrt{-2})(1 + \sqrt{-2})$
- $11 = (3 - \sqrt{-2})(3 + \sqrt{-2})$
- $17 = (3 - 2\sqrt{-2})(3 + 2\sqrt{-2})$
- $19 = (1 - 3\sqrt{-2})(1 + 3\sqrt{-2})$
- etc.
Obviously, numbers like 5 or 7, which are prime in $\mathbb{Z}$ are still prime in $\mathbb{Z}[\sqrt{-2}]$ (they are inert primes). These inert primes can't be expressed as $a^2 + 2b^2$.
But if $p \equiv 5$ or $7 \pmod 8$ and $\alpha$ is even, then $p^\alpha = (p^{\frac{\alpha}{2}})^2$. Assign $q = p^{\frac{\alpha}{2}}$. Then $p^\alpha = (q - 0\sqrt{-2})(q + 0\sqrt{-2})$. To satisfactorily solve the problem you still need to prove what happens when $\alpha$ is odd, but I'm confident you can figure this out for yourself.
I'd like to close with a couple of examples:
- $3 \times 5 = (1 - \sqrt{-2})(1 + \sqrt{-2})5$
- $3 \times 5^2 = (1 - \sqrt{-2})(1 + \sqrt{-2})5^2 = (5 - 5\sqrt{-2})(5 + 5\sqrt{-2}) = 5^2 + 2 \times 5^2 = 75.$