Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

$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?

share|cite|improve this question
up vote 10 down vote accepted

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


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$...

share|cite|improve this answer
$(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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.