# Prove that for every prime number $p>3$, $4p^2+1$ can be written as the sum of three square numbers

Given that $p>3$ prove that $4p^2+1$ can be written as the sum of three distinct positive square numbers.

Plugging in $5$ I get $101=49+36+16=7^2+6^2+4^2$

I also know that all primes greater than $3$ can be written in the form $3k+1$ and $3k+2$ but plugging those values in I get:

$36k^2+24k+5$, $36k^2+48k+17$ and the solution probably lies in arranging these numbers in such a way that we get the desired squares, but I can't come up with a combination ,or is my "idea" not even in the right direction?

• It looks to me like $2p$, $1$ and $0$ will work for any $p$. Commented Apr 12, 2017 at 15:44
• I assume one of them must be nonzero? Commented Apr 12, 2017 at 15:45
• only natural numbers forgot to add that part Commented Apr 12, 2017 at 15:46
• yes $p$ can only be a prime EDIT: it says so in the title Commented Apr 12, 2017 at 15:48
• Unfortunately, "natural numbers" in some places includes $0$, so you should said "positive integers" to be clear. Commented Apr 12, 2017 at 15:51

We know that $p=6n\pm1$. Here $$4(6n-1)^2+1=144n^2-48n+5=(8n-1)^2+(8n-2)^2+(4n)^2.$$ You figure out what changes are needed to do the case with plus signs.

• In other words, $p$ being a prime number plays no real role. Any integer congruent to $\pm1\pmod6$ will do. I suspected as much, as it is a bit difficult to see how primeness of $p$ would be used. Commented Apr 13, 2017 at 11:57

If $p=6k\pm 1$ then $4p^2+1 = 144k^2\pm 48k +5$.

So you might want to write $$4p^2+1 = (ak+1)^2+(bk+2)^2+(ck)^2=(a^2+b^2+c^2)k^2+(2a+4b)k+5$$

So you need to find $a,b,c$ so that $a^2+b^2+c^2=144, a+2b=\pm 24$, and $c\neq 0$.

I'll leave it to you to solve for $a,b,c$.

But you might get a quess of what they are by looking at the case $p=7$ along with your solution for $p=5:$

$$4\cdot 7^2+1 = 9^2+10^2+4^4$$