Are two sequences equal if the sums and sums of squares are equal? Are two sequences $(x_i)_{i=1,\ldots,n}$ and $(y_i)_{i=1,\ldots,n}$ equal if $\sum_{i=1}^nx_i=\sum_{i=1}^ny_i$ and $\sum_{i=1}^nx_i^2=\sum_{i=1}^ny_i^2$?
 A: There are many examples. Here's the first in a long sequence:
$$
(1,4,6,7) \quad (2,3,5,8).
$$
This comes from the first eight entries in the Thue Morse sequence (third line below). The fourth line specifies two sets of eight numbers with the same sum, sum of squares and sum of cubes.
AB 
AB BA 
ABBA BAAB  
ABBABAAB BAABABBA
...

The Prouhet-Tarry-Escott problem and generalized Thue-Morse sequences. J. Comb. 7 (2016), no. 1, 117--133, [Bolker, Ethan D. and Offner, Carl and Richman, Robert and Zara, Catalin] 
Here's the preprint: https://arxiv.org/abs/1304.6756
A: No.
$$ x = (1,1,1,-3) $$
$$ y = (-1,-1,-1,3) $$
$$\sum x_i = \sum y_i = 0$$
$$ \sum x_i^2 = \sum y_i^2 =12$$
A: No! You need $n$ polynomial equations.
If I remember correctly, given a set of $n$ distinct real numbers $\mathcal Y :=\{y_1, y_2, \dots, y_n\}$, the following system of $n$ polynomial equations
$$\begin{array}{rl} x_1 + x_2 + \dots + x_n &= c_1\\ x_1^2 + x_2^2 + \dots + x_n^2 &= c_2\\ \vdots \\ x_1^n + x_2^n + \dots + x_n^n &= c_n\end{array}$$
where
$$c_k := y_1^k + y_2^k + \dots + y_n^k$$
has $n!$ solutions, namely, all $n!$ permutations of the $n$ distinct elements of $\mathcal Y$. One can use algebraic geometry to prove this. I vaguely recall this being related to moment problems.

Example
Let $\mathcal Y := \{1,3,6\}$. Intersecting the plane with the sphere,
$$\begin{array}{rl} x_1 + x_2 + x_3 &= 10\\ x_1^2 + x_2^2 + x_3^2 &= 46\end{array}$$
we obtain a circle on the plane, as depicted below

However, intersecting these two with the cubic surface,
$$\begin{array}{rl} x_1 + x_2 + x_3 &= 10\\ x_1^2 + x_2^2 + x_3^2 &= 46\\ x_1^3 + x_2^3 + x_3^3 &= 244\end{array}$$
we obtain the $3!=6$ permutations of the elements of $\mathcal Y$, which are colored in red

If we plot the quadratic and the cubic surfaces, but not the plane,

and, from another point of view, we have what looks like a stylish hat


A: Something interesting. On all $3 \times 3$ magic squares, the sums of the top and bottom rows is the same (of course) but, also, the sums of the squares of the top and bottom rows is the same. For example
\begin{array}{|c|c|c|}
\hline
   8 & 3 & 4 \\
\hline
   1 & 5 & 9 \\
\hline
   6 & 7 & 2 \\
\hline
\end{array}
$8 + 3 + 4 = 6 + 7 + 2 = 15$
$8^2 + 3^2 + 4^2 = 6^2 + 7^2 + 2^2 = 89$
Also
$8 + 1 + 6 = 4 + 9 + 2 = 15$
$8^2 + 1^2 + 6^2 = 4^2 + 9^2 + 2^2 = 101$
This seems to work for some families of larger order magic squares, but I haven't been able to prove it.
A: To consider an even more basic counterexample. What happens if you simply reorder your sequence? Take $x = (0,1)$ and $y = (1,0)$. (I assume you're talking about sequences, so above $x \neq y$; of course, as sets, $\{0,1\} = \{1,0\}$.)
