# Can two distinct sets of $N$ non-negative numbers have the same sum and sum of squares?

Suppose I have a set of $N$ non-negative numbers that sum to $A$. The sum of squares of these $N$ non-negative numbers sum to $B$.

Here's the question: can there be a different set of $N$ non-negative numbers that also sum to $A$ and whose sum of squares also equal $B$?

In other words - is the combination of the set of $N$ numbers, their sum $A$ and there sum of squares $B$ unique?

• – individ Sep 3 '15 at 4:28
• To solve any system of equations. Need to put the condition - how it should look. – individ Sep 3 '15 at 4:32

Yes! In fact it's possible to find such sets even if you require the sum of cubes and the sum of fourth powers, etc. to be the same (up to some $k$-th power sum).

Here's an example for the sum and the sum of squares: $\{1,4,6,7\}$ and $\{2,3,5,8\}$.

The sums are $$1+4+6+7=18=2+3+5+8$$ and $$1^2+4^2+6^2+7^2=102=2^2+3^2+5^2+8^2$$

More fun! Here's a solution which also matches on the sum of cubes: $\{1,4,6,7,10,11,13,16\}$ and $\{2,3,5,8,9,12,14,15\}$.

This generalization comes from the Thue-Morse sequence.

• Is it just a coincidence that the numbers cover 1-8, or is that a general rule? – Forgottenscience Sep 2 '15 at 20:18
• @Forgottenscience It's always possible to do it with the numbers $\{1,...,2^{k+1}\}$ where $k$ is the largest power required to be the same (I'm trying to track down the paper at the moment). I don't know for sure whether other solutions are possible, but I suspect so. – Peter Woolfitt Sep 2 '15 at 20:20
• Wow. That's awesome. Thank you so much. – C Shreve Sep 2 '15 at 21:40
• @CShreve I'm just really glad you asked - this is one of my favorite mathematical tidbits :). – Peter Woolfitt Sep 2 '15 at 22:22