I have two integer sets ($X=\{x_1,x_2,...,x_k\}, Y=\{y_1,y_2,...,y_k\}$) with equal sizes ($k$) with unique values. I was just wondering if there are any integer solutions to: $$\sum_i x_i = \sum_i y_i$$ and $$\sum_i {x_i}^2 = \sum_i {y_i}^2$$ for any $k>2$?
There is an answer for $k=2$ here: https://www.quora.com/Does-a-b-c-d-and-ab-cd-mean-a-b-c-d
but I'm just wondering can we generalize it for $k>2$?
Yes. One of the comments links to a similar question which gives $\{ 1,6,8 \}$ and $\{ 2,4,9\}$ as examples (and there are many more for small values of $k$).
One of the beautiful things about this problem is that it is intrinsically translation-invariant (also scale-invariant): we actually have, as polynomials,
$$(x+1y)^2 + (x+6y)^2 + (x+8y)^2 = (x+2y)^2 + (x+4y)^2 + (x+9y)^2.$$
So we can use a single example for $k=3$ or $k=4$, etc. to generate any number of examples. By choosing these examples well, we can glue multiple shifted copies together and keep the entries unique. So this should easily build examples for all $k>2$.