a^n + b^n + c^n = d^n + e^n + f^n, n = 1, 2

To determine all quadruples of positive integers   $(a, b, c; k)$   for which

$a \; + \; b \; + \; c \; = \; (k-a) \; + \; (k-b) \; + \; (k-c)$
$a^2 \; + \; b^2 \; + \; c^2 \; = \; (k-a)^2 \; + \; (k-b)^2 \; + \; (k-c)^2$

and to find a generalization

Since

$a \; + \; b \; + \; c \; = \; (k-a) \; + \; (k-b) \; + \; (k-c)$
$2 \,(a + b + c) \; = \; 3 \, k$
$a^2 \; + \; b^2 \; + \; c^2 \; = \; (k-a)^2 \; + \; (k-b)^2 \; + \; (k-c)^2$
$(a^2 + b^2 + c^2) \; - \; ((k-a)^2 + (k-b)^2 + (k-c)^2) \; = \; 0$
$2 \, a \, k \; + \; 2 \, b \, k \; + \; 2 \, c \, k \; - \; 3 \, k^2 \; = \; 0$
$2 \, k \, (a + b + c) \; - \; 3 \, k^2 \; = \; 0$

So, all that is required is to select   $a, b, c$   so that their sum is divisible by 3.

Take   $k \; = \; (2/3) \; (a + b + c)$

For example,

(a,b,c)   ……..   k       (k-a)   (k-b)   (k-c)

(1,4,4)   ……….   6            (5   2   2)
(3,8,10)   …….   14           (11   6   4)
(6,11,13)   ……   20           (9   8   7)
(8,13,15)   ……   24           (16   11   9)

$1 \; + \; 4 \; + \; 4 \; = \; 5 \; + \; 2 \; + \; 2 \; = \; 9$
$1^2 \; + \; 4^2 \; + \; 4^2 \; = \; 5^2 \; + \; 2^2 \; + \; 2^2 \; = \; 33$

$3 \; + \; 8 \; + \; 10 \; = \; 4 \; + \; 6 \; + \; 11 \; = \; 21$
$3^2 \; + \; 8^2 \; + \; 10^2 \; = \; 4^2 \; + \; 6^2 \; + \; 11^2 \; = \; 173$

$6 \; + \; 11 \; + \; 13 \; = \; 7 \; + \; 9 \; + \; 14 \; = \; 30$
$6^2 \; + \; 11^2 \; + \; 13^2 \; = \; 7^2 \; + \; 9^2 \; + \; 14^2 \; = \; 326$

$8 \; + \; 13 \; + \; 15 \; = \; 9 \; + \; 11 \; + \; 16 \; = \; 36$
$8^2 \; + \; 13^2 \; + \; 15^2 \; = \; 9^2 \; + \; 11^2 \; + \; 16^2 \; = \; 458$

A generalization;

If   $a_1, \; a_2, \; ..., \; a_n$   are positive integers whose sum is divisible by   $n$   and if

$k \; = \; 2(a_1 \; + \; a_2 \; + \; ... \; + \; a_n)/n$,     then

$a_1 \; + \; a_2 \; + \; ... \; + \; a_n \; = \; (k - a_1) \; + \; (k - a_2) \; + \; ... \; + \; (k - a_n)$
$a^2_1 \; + \; a^2_2 \; + \; ... \; + \; a^2_n \; = \; (k - a_1)^2 \; + \; (k - a_2)^2 \; + \; ... \; + \; (k - a_n)^2$