33

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.

Fabrosi
  • 673
Derris
  • 401
  • 4
  • 7
  • Since I have no intuitive idea why this should be true I would try to compute some and compare, just to see whether it actually holds for bigger primes or not and maybe to see a scheme – user190080 Jul 23 '15 at 21:51
  • I do this let $p = c^2 + 2d^2$ then $p^2 = c^4 + 4c^2d^2 + 4d^4$ what we are looking for is $c,d$ in terms of $a,b$ such that $c^4 + 4c^2d^2 + 4d^4 = a^2 + 2b^2$. I tried to factor them in way to get a similar pastern. $(c^4 + 2c^2d^2 + d^4) + 2c^2d^2 +3d^4= (c^2+d^2)^2 + 2c^2d^2+3d^4$. – IrbidMath Jul 23 '15 at 22:08
  • But this is not true for $p=5$, as we have $5 = 1 + 2 \times 2$, so $a=1$, but $b^2 = 2$, so $b$ is no integer... – johannesvalks Jul 23 '15 at 22:14
  • @johannesvalks Did you mix up the intent of the post? – Cameron Williams Jul 23 '15 at 22:29
  • @CameronWilliams, indead - the IF is important. Thanks for the reply... – johannesvalks Jul 23 '15 at 22:30
  • I'll leave this as a comment since I couldn't go much further. -----

    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

2 Answers2

14

Here's an elementary proof.

From $p^2=a^2+2b^2$, we have $2b^2=(p-a)(p+a)$. Since $b\not=0$, we have $\gcd(a,b)=1$ and consequently $\gcd(p-a,p+a)=2$. Let's write $m=(p-a)/2$ and $n=(p+a)/2$, so that $\gcd(m,n)=1$ and $mn=2\beta^2$ where $\beta=b/2$. (It's easy to see that $b$ must be even.)

Without loss of generality (since $a$ can be either positive or negative), we can assume that $m$ is even. But since $\gcd(m,n)=1$, we must now have $m=2r^2$ and $n=s^2$, with $\gcd(2r,s)=1$ -- i.e., each prime factor of $\beta$ belongs entirely to either $m$ or $n$. So we now have

$$m={p-a\over2}=2r^2$$ and $$n={p+a\over2}=s^2$$

from which it follows that

$$p=s^2+2r^2$$

Barry Cipra
  • 79,832
  • 2
    Thank you. Wow, this is amusing. I really need to take my time and study some number theory. Its not part of syllabus, but I'm sure my teahcer has something if I ask nicely. – Derris Jul 24 '15 at 09:21
  • 2
    Hey I had a doubt - why does gcd(a,b)=1? Sorry if it was fairly obvious, I couldnt follow this point along the proof. – Shagun Sodhani Jul 28 '15 at 16:49
  • 2
    @Shagun, the gcd has to divide $p^2$ (in fact it has to divide $p$), which it does if $(a,b)=(p,0)$. But the assumption $b\not=0$ prohibits this. – Barry Cipra Jul 28 '15 at 19:13
  • Great! Thanks :) – Shagun Sodhani Jul 29 '15 at 08:20
4

Let's assume that $p$ is odd and use a bit of algebraic number theory.

Consider the field $\mathbb{Q}(\sqrt{-2})$, which has the ring of integers $\mathbb{Z}[-2]$. This is a Dedekind domain, so ideals factor uniquely, and so a PID.

By the question we have $(p^2)=(p)^2=(a^2+2b^2)$ and we want $(p)=(c^2+2d^2)$, as then have $p=u(c^2+2d^2)$ for some unit $u$ (the only units in $\mathbb{Z}[-2]$ are $\pm 1$, and by sign, $u=1$).

It's proven (c.f. Ireland and Rosen, page 190) that $(p)$ splits up into a product of one or two prime ideals in one of three ways. This depends on two conditions on $p$.

(Let $P,P'$ be distinct prime ideals throughout).

  • For finitely many $p$ (condition: $p\mid -8$, $-8$ being the discriminant of the field), $(p)=P^2$. But this only concerns $p=2$ so we move on to cases where $p \not \mid -8$.

  • If $x^2=-2 \text{ mod }p$ is soluble in $\mathbb{Z}$, then $(p)=PP'$. $\mathbb{Z}[-2]$ is a a PID so $(p)=(x)(y)=(xy)$ for $x \ne y$, and have $p=uxy=\pm xy$. Necessarily $x=\bar{y}=c+d\sqrt{-2}$ and hence the result.

  • If not soluble, then $(p)=P$, in which case your result would not hold. But if $(p)$ is prime, $p$ is prime in $\mathbb{Z}[\sqrt{-2}]$, then $p^2=(a+\sqrt{-2}b)(a-\sqrt{-2}b)$ implies that $(a+\sqrt{-2}b),(a-\sqrt{-2}b)$ are prime. But then $a=p,b=0$ by unique factorisation.

Meow
  • 6,353
  • With hindsight splitting into the three cases was unnecessary, you only need that $(p)$ splits into one or two prime ideals, but maybe it's instructional to leave it in. – Meow Jul 23 '15 at 22:11
  • Thank you, much apprechiated. – Derris Jul 24 '15 at 09:22