# What values can $n$ assume, when $z^2+n= x^2+y^2$?

$x^2+y^2 =n +z^2$ where $x,y,z$ are different natural numbers. What values can $n$ assume?

What if x,y,z>0 considering the confusion of 0 as natural number?

-

Any odd number : $0^2+(n+1)^2=(2n+1)+n^2$

Any positive even number : $1^2+(n+1)^2=(2n+2)+n^2$

Any negative odd number : $0^2+n^2=-(2n+1)+(n+1)^2$

Any negative even number : $1^2+n^2=-2n+(n+1)^2$

If you really need to have different numbers x y z just remark that

$5^2+11^2=2+12^2$

and $3^2+5^2= -2 + 6^2$

If you need x, y, z to be non zero for odd numbers :

$2^2+(n+1)^2=(2n-3)+n^2$ for example... $2^2+n^2=-(2n-3)+(n+1)^2$

and for the case 1 (all different) $4^2+7^2=1+8^2$ and $4^2+8^2=-1+9^2$...

-
$(n+1)^2+(-2n)=n^2+1^2$ – N. S. Jul 24 '12 at 13:40
Also the negative numbers, by using $n-1$ in place of $n+1$. – Gerry Myerson Jul 24 '12 at 13:41
We know $(r^2-s^2)+(2rs)^2=(r^2+s^2)^2$ for all integer r,s=>0 is obvious. Is 0 a natural number? – lab bhattacharjee Jul 24 '12 at 13:42
I just add the negative ones :) – Xoff Jul 24 '12 at 13:43
"where $x,y,z$ are different natural numbers" may cause some trouble for, e.g., $2$. – TMM Jul 24 '12 at 13:46