# Show that equation $x^2+y^2+z^2=(x-y)(y-z)(z-x)$ has infinitely many solutions in integers $x,y,z$

While solving some old INMO problems I found that one, and I am completely stuck at it. The problem is:

Show that the equation $x^2+y^2+z^2=(x-y)(y-z)(z-x)$ has infinitely many solutions in integers $x,y,z$.

I shall be thankful if you can provide me any hints or suggestions. Thanks.

• Asked before (no answers, but one possible solution in comments): Show that the equation $x^2+y^2+z^2= (x-y)(y-z)(z-x)$ has infinitely many solutions in integers $x, y, z$. – Winther Nov 28 '16 at 17:23
• What is INMO? – user940 Nov 28 '16 at 17:47
• Well, to begin with if $z = 0$ then $x^2 + y^2 = (x-y)y(-x) =-y^2x - x^2y$ and $x^2(1+ y)= y^2(1-x)$ will have infinite solutions if $x = -y$ and $x^2(1-x) = x^2(1-x)$ for all real $x$. That's inefficient but sufficient to show there are infinite solutions – fleablood Nov 28 '16 at 17:49
• @ByronSchmuland, INMO is Indian National mathematical olympiad. – Vidyanshu Mishra Nov 28 '16 at 17:51
• @fleablood, I thought the same, as I always try same thing whenever I see such questions (where infinite solutions are required). But a national level competition always require a pure mathematical proof. – Vidyanshu Mishra Nov 28 '16 at 17:52

In this type of problems when you have to prove that there are infinitely many solutions it's convenient to look for possible values in P.A. So, suppose that $z-y=y-x=k$, then $z-x=2k$ and our equation becomes $$x^2+(x+k)^2+(x+2k)^2=2k^3.$$

So, after a little calculus we get the equation $3x^2+(6k)x+(5k^2-2k^3)=0$. Using the formula for the quadratic equation gives us $$x=\frac{-6k\pm \sqrt{(6k)^2-12(5k^2-2k^3)}}{6}=-k\pm \frac{k\sqrt{6(k-1)}}{3}.$$

Now, since we want $x\in \mathbb{Z}$ we need that $6(k-1)=u^2$ for some $u\in \mathbb{Z}$. Then $6\mid u^2$, so $6\mid u$ (why?). Set $u=6t$, thus we get $k=6t^2+1$ and hence we get $x=-(6t^2+1)\pm (6t^2+1)(2t)$. If we take the plus sign we get $x=12t^3-6t^2+2t-1$. Now, since $y=x+k$ and $z=x+2k$, replacing $x$ gives us $y=12t^3+2t$ and $z=12t^3+6t^2+2t+1$.

Finally, you can check that $$(12t^3-6t^2+2t-1)^2+(12t^3+2t)^2+(12t^3+6t^2+2t+1)^2=2(6t^2+1)^3.$$

Hence, the equation has infintely many integer solutions.

• Isn't this the official solution given by the Olympiad committee? – N.S.JOHN Nov 30 '16 at 3:08
• @N.S.JOHN I got this solution on my own. I didn't even know what was the meaning of "INMO" until the OP said it in one of his comments. – Xam Nov 30 '16 at 4:03

$$x^2+y^2+z^2 = (x-y)(y-z)(z-x) \tag{*1}$$

one look at a simpler problem first. Let's say you have found a non-trivial integer solution for $$(u-v)(v-w)(w-u)|u^2+v^2+w^2\tag{*2}$$

one can set $\lambda$ to the integer $\displaystyle\;\frac{u^2+v^2+w^2}{(u-v)(v-w)(w-u)}\;$ and $(x,y,z) = (\lambda u,\lambda v, \lambda w)$ will give us a solution for $(*1)$.

It turns out it isn't that hard to find solutions for $(*2)$. One just take any two non-zero integers $p, q$, set $(u,v,w) = (v-p,v,v+q)$ and looks for expression of $v$ which makes $$pq(p+q) \;|\; (v-p)^2 + v^2 + (v+q)^2 = 3v^2 -2(p-q)v + (p^2+q^2)$$

For $p = q = 1$, we find

$$(u,v,w) = (2t-1,2t,2t+1) \quad\implies\quad \lambda = \frac{(2t-1)^2 + (2t)^2 + (2t+1)^2}{(-1)(-1)(2)} = 6t^2+1$$ This will give us a parametrized family of solution of $(*1)$ $$(x,y,z) = ((2t-1)(6t^2+1), 2t(6t^2+1), (2t+1)(6t^2+1))$$

This demonstrate the original equation $(*1)$ does have infinitely many solutions.

Others solutions can be constructed in similar manner. For example, take $p = 1, q = 2$, we find $v = 6t-1$ give us another family of solutions: $$(x,y,z) = ((6t-2)(18t^2-4t+1),(6t-1)(18t^2-4t+1),(6t+1)(18t^2-4t+1))$$ The more interesting question is whether there are some ways to systematically exhaust all solutions of $(*1)$ and I've no idea on that.

• in case of interest, I posted a bunch of solutions. Surprising to find one with large entries but gcd(x,y,z) = 1:: 4276866 1063 1184 1321 – Will Jagy Nov 28 '16 at 20:47
• I see. 151 does occur as the gcd for both your families, but the one with $18 t^2 - 4 t + 1$ does not happen until $t=3$ and $z = 2869$ in the way I had the computer creating the list. – Will Jagy Nov 28 '16 at 20:54
• @WillJagy interesting, at least we now know the equation do have "real" primitive solution instead of the ones we cooked up. It is still hard to detect any pattern among the solutions :-( – achille hui Nov 28 '16 at 21:10
• The typical thing for contests is the Vieta Jumping type of behavior. This one does not fit, as the coefficients for $x^2, y^2, z^2$ are not really one at all, since the right hand side has terms such as $x y^2$ and the like. – Will Jagy Nov 28 '16 at 21:14
• @WillJagy this is still doable within a contest as long as one give up finding primitive solution and try simpler version like here. Once one give up, it isn't that hard at all. maybe that's the intended purpose. – achille hui Nov 28 '16 at 21:23

These are all solutions with $$-2 \leq x < y < z < 1700.$$ For some reason there are just a few solutions with some positive entries and some negative, that probably has a short proof. Anyway, once all three are positive and distinct, it is easy to see that we can demand $x<y<z.$

   x^2 + y^2 + z^2   x      y      z   x^2 + y^2 + z^2 FACTORED
6         -2     -1      1              6 =  2 3     gcd(x,y,z) 1
2         -1      0      1              2 =  2     gcd(x,y,z) 1
6         -1      1      2              6 =  2 3     gcd(x,y,z) 1
686          7     14     21            686 =  2 7^3     gcd(x,y,z) 7
20250         55     85    100          20250 =  2 3^4 5^3     gcd(x,y,z) 5
20250         60     75    105          20250 =  2 3^4 5^3     gcd(x,y,z) 15
31250         75    100    125          31250 =  2 5^6     gcd(x,y,z) 25
73002        115    161    184          73002 =  2 3 23^3     gcd(x,y,z) 23
140250        175    205    260         140250 =  2 3 5^3 11 17     gcd(x,y,z) 5
156750        155    250    265         156750 =  2 3 5^3 11 19     gcd(x,y,z) 5
332750        275    330    385         332750 =  2 5^3 11^3     gcd(x,y,z) 55
384846        259    266    497         384846 =  2 3 7^3 11 17     gcd(x,y,z) 7
1647750        650    715    845        1647750 =  2 3 5^3 13^3     gcd(x,y,z) 65
1825346        679    776    873        1825346 =  2 97^3     gcd(x,y,z) 97
2409066        736    943    989        2409066 =  2 3^2 11 23^3     gcd(x,y,z) 23
3188646        891   1053   1134        3188646 =  2 3^13     gcd(x,y,z) 81
3188646        918    999   1161        3188646 =  2 3^13     gcd(x,y,z) 27
2676750        775    790   1205        2676750 =  2 3 5^3 43 83     gcd(x,y,z) 5
3668250        860   1195   1225        3668250 =  2 3 5^3 67 73     gcd(x,y,z) 5
4276866       1063   1184   1321        4276866 =  2 3 11^2 43 137     gcd(x,y,z) 1
5343750       1150   1175   1625        5343750 =  2 3^2 5^6 19     gcd(x,y,z) 25
6885902       1359   1510   1661        6885902 =  2 151^3     gcd(x,y,z) 151
x^2 + y^2 + z^2   x      y      z    x^2 + y^2 + z^2 FACTORED

• these things are going over my head. please elaborate a bit what you have written. It is just a table full of numbers. – Vidyanshu Mishra Nov 28 '16 at 17:59