I'm high school student, and this problem has bothered me for about 2 weeks now. I don't necessarily need a solution, but for example mentioning a helpful theorem or property that could help me to prove this would be nice.
If $p^2$ can be written in form $a^2 + 2b^2$ show that also $p$ can be written in same form, where $p$ is a prime number, and $a,b\in\mathbb{Z},b\neq0$.
This far I've tried pretty much everything that comes into my imagination. I can assume $p$ is odd since $2^2$ cannot be written in desired form. From this I can conclude $a$ must also be odd. From this I can also substitute $2z + 1 = p$ to left hand side of this equation which I obtained from assumption ($p^2 = a^2 + 2b^2$). The left hand side ($p^2$) looks like this when I expand square: $4z^2 + 4z + 1$. From here I've subtracted $4z^2$ and $2z$ from both sides of equation, just leaving $2z + 1= p$ on the left side. The right hand side would look like this: $a^2 + 2b^2 - 4z^2 - 2z$, and I don't know how to prove something in that mess of terms forms a perfect square.
This problem started to seem even more mystic for me once I investigated a few examples. To my surprise there doesn't appear any obvious relations between $a$ and $b$ for $p$ and for $p^2$. Could it be so that my approach is entirely wrong, and it's not possible to derive $a$ and $b$ for $p$ from those numbers for $p^2$?
I also tried to find relations by writing an equation based on this so that $p$ was constant and $a$ and $b$ were variables. Then I investigated if curve crossed any point that had integer coordinates and then compared such points for different constants, especially for different $p^2$ and $p$. I used also implicit differentiation to see if there is any harmony on their placement on ellipse (curve is always ellipse of same shape, but size of it differs depending on constant) but so far I haven't found anything.
I will add I'm quite unfamiliar with math, so I'd appreciate it if advice would be understandable for person who does not have a very deep knowledge of math.
We can check that $4$ can not be written $a^2+2b^2$ by exhausting choices of $a,b$. So indeed $p^2$ is odd.
Then $p^2-a^2=(p-a)(p+a)=2b^2$. Since $p$ and $a$ are odd, there are two factors of $2$ on the right and therefore $3$ since $b$ must be even for this to be true. This means $p^2-a^2=8c^2$ and $p^2=a^2+8c^2$.
– Eoin Jul 23 '15 at 23:14