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

I was solving a programming problem where I needed to prove that sum of squares of $n$ numbers is unique. i. e. if calculate the sum of squares of equal number of positive integers then if they are same it means that all numbers are the same.

How do I prove it?

The range of numbers is between 0 and 127(inclusive)
or does the range matter?
share|cite|improve this question
But $7^2+1^2=5^2+5^2$ ! – Hagen von Eitzen Jul 20 '13 at 13:41
Or even $3^2+4^2 = 5^2+0^2$ – TZakrevskiy Jul 20 '13 at 13:42
Sure, $11^2+2^2=10^2+5^2$ or $7^2+4^2=8^2+1^2$ – Hagen von Eitzen Jul 20 '13 at 13:43
@HagenvonEitzen ah, that is more satisfying. And now I see how such examples are easily found: $a^2+b^2=c^2+d^2$ is equivalent to $(a-c)(a+c)=(d-b)(b+d)$, so you just look for two different factorizations of a number. – Harald Hanche-Olsen Jul 20 '13 at 13:44
Find here( for the number of representations of an sum of squares – lab bhattacharjee Jul 20 '13 at 13:49

Your Answer


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

Browse other questions tagged or ask your own question.