Determine all integers $x,\ y,\ z$ that satisfy $x+y+z=(x-y)^{2}+(y-z)^{2}+(z-x)^{2}$
Solution 1:
Let $y=u+x$ and $z=v+x$, then $y-z = u-v$ and hence $$ \begin{align} (y-u) + y + (y-u+v) &= u^2 + (u-v)^2 + v^2\\ 3y &= 2u^2 + 2v^2 - 2uv +2u - v \end{align} $$ So we can almost freely choose $u,v$, but we need RHS to be divisible by $3$. By considering the equation modulo $3$, we see that solutions are $$ (u,v) \equiv (0,0),(0,2),(1,1),(1,2),(2,0),(2,1) \pmod 3 $$ For example, taking $(u,v)\equiv (0,0)\pmod 3$, this gives parametrizations: $$ \begin{align} u = 3m, v = 3n &\implies y= 2 m + 6 m^2 - n - 6 m n + 6 n^2\\ &\implies x = -m + 6 m^2 - n - 6 m n + 6 n^2\\ &\implies z = -m + 6 m^2 + 2n - 6 m n + 6 n^2 \end{align} $$ where we can freely choose $m,n\in\mathbb Z$. The other cases are the same.
Edit 1: One more case: let $(u,v)\equiv (2,1)\pmod 3$, so that $$ u = 3m+2,\quad v = 3n+1 $$ then $$ \begin{align} y &= 3 + 8 m + 6 m^2 - n - 6 m n + 6 n^2\\ x = y-u &= 1 + 5 m + 6 m^2 - n - 6 m n + 6 n^2\\ z =v+x &= 2 + 5 m + 6 m^2 + 2 n - 6 m n + 6 n^2 \end{align} $$
Solution 2:
The surface is a paraboloid of revolution around the line $x=y=z$
If we define $$ u = x+y+z, \; \; v = -x + y, \; \; w = -x -y + 2z, $$ then we demand $$ v \equiv w \pmod 2 \; , $$ take solutions of $$ 2u = 3 v^2 + w^2 \; , $$ and further demand $$ u + w \equiv 0 \pmod 3 \; , $$ we have a solution to the original problem. That is $$ x = \frac{2u-3v-w}{6} \; , \; \; y = \frac{2u+3v-w}{6} \; , \; \; z = \frac{u+w}{3} \; . $$ Negating $v$ just interchanges $x,y$ so we might as well take $v \geq 0.$ Other than that, I just took $v \equiv w \pmod 2,$ next $u = \frac{3v^2 + w^2}{2}.$ Sometimes this $u$ was not suitable $\pmod 3,$ so I printed out things only when $u + w \equiv 0 \pmod 3.$
==============================================
int bound = 10;
for(int wabs = 0; wabs <= bound; ++wabs){
int vstart = wabs % 2;
for(int v = vstart; v <= bound; v += 2){
for(int wsign = 1; wsign >= -1; wsign -= 2) {
int w = wsign * wabs;
int u = ( 3 * v * v + w * w ) / 2;
if( abs(u + w ) % 3 == 0 )
{
int z = (u + w)/3;
int y = ( 2 * u - 3 * v - w) / 6 ;
int x = ( 2 * u + 3 * v - w) / 6 ;
cout << setw(6) << x << setw(6) << y << setw(6) << z << " " << setw(6) << u << setw(6) << v << setw(6) << w << endl;
} // if 3
}}}
================
x y z u v w
0 0 0 0 0 0
0 0 0 0 0 0
3 1 2 6 2 0
3 1 2 6 2 0
10 6 8 24 4 0
10 6 8 24 4 0
21 15 18 54 6 0
21 15 18 54 6 0
36 28 32 96 8 0
36 28 32 96 8 0
55 45 50 150 10 0
55 45 50 150 10 0
1 0 1 2 1 1
6 3 5 14 3 1
15 10 13 38 5 1
28 21 25 74 7 1
45 36 41 122 9 1
1 1 0 2 0 -2
4 2 2 8 2 -2
11 7 8 26 4 -2
22 16 18 56 6 -2
37 29 32 98 8 -2
56 46 50 152 10 -2
2 1 3 6 1 3
3 2 1 6 1 -3
7 4 7 18 3 3
8 5 5 18 3 -3
16 11 15 42 5 3
17 12 13 42 5 -3
29 22 27 78 7 3
30 23 25 78 7 -3
46 37 43 126 9 3
==========================
sort by x,y,z
x y z u v w
1 0 1 2 1 1
1 1 0 2 0 -2
2 1 3 6 1 3
2 2 4 8 0 4
3 1 2 6 2 0
3 1 2 6 2 0
3 2 1 6 1 -3
4 2 2 8 2 -2
5 3 6 14 2 4
5 5 8 18 0 6
6 3 5 14 3 1
6 5 3 14 1 -5
7 4 7 18 3 3
7 7 4 18 0 -6
8 5 5 18 3 -3
8 6 10 24 2 6
8 7 11 26 1 7
10 6 8 24 4 0
10 6 8 24 4 0
10 8 6 24 2 -6
11 7 8 26 4 -2
11 8 7 26 3 -5
12 12 8 32 0 -8
12 8 12 32 4 4
13 10 15 38 3 7
13 12 17 42 1 9
15 10 13 38 5 1
15 11 16 42 4 6
15 13 10 38 2 -8
15 15 20 50 0 10