# Modified sum of three squares problem

My teacher proposed this problem some time ago:

We have four different integers $$x,y,z,k$$ such that $$x^2+y^2+z^2=3k^2$$. Prove that the difference between the largest one of $$x,y,z$$ and the smallest one of $$x,y,z$$ is greater than $$\sqrt{k\,}$$.

The time for submissions is over so I thought I might ask here. I'm not sure it's ok with the rules here, especially that I haven't made any progress. I will still share what I've tried:

• $$k$$ is a quadratic mean, however I could not find any mean bigger than it;
• sub $$y = x + t$$ and $$z = x+v$$ doesn't seem to help show $$t > \sqrt{k\,}$$ or $$v > \sqrt{k\,}$$
• geometric thinking of a sphere equation and looking for integer points is even more complicated
• if one allows $x=y=z=k$ then the difference is $0<\sqrt{k}$. I just wonder what would make the answer be different if the integers are different ... can't we find (perhaps big) $x,y,z,k$ that are "approximately" equal and satisfy the above (i.e. $x^2+y^2+z^2=3k^2$) yet $z-x<\sqrt{k}$ ? (We could assume $0<x<y<z$ for convenience.) Commented Mar 16, 2021 at 20:54
• @Mirko The question says "four different integers." Commented Mar 16, 2021 at 21:02
• @Mirko Oh, I see. That makes sense. Commented Mar 16, 2021 at 21:05
• @Mirko One nontrivial solution is $(x,y,z,k)=(1,5,7,5)$. Reducing mod $8$ shows that wlog $x$, $y$, $z$ and $k$ are all odd, and reducing mod $3$ shows that wlog $x$, $y$ and $z$ are not divisible by $3$, and this solution is then the 'smallest' remaining candidate. Commented Mar 16, 2021 at 22:38
• @Mirko Checking a few small triplets yields the following solutions $(x,y,z,k)$: \begin{eqnarray*} (1,&5,&11,&7),\\ (1,&5,&29,&17),\\ (1,&7,&25,&15),\\ (5,&7,&13,&9),\\ (5,&7,&17,&11),\\ (5,&11,&19,&13),\\ (5,&11,&23,&15),\\ (5,&11,&29,&17),\\ (5,&17,&19,&15),\\ (7,&13,&17,&13),\\ (7,&17,&23,&17),\\ (11,&19,&29,&21),\\ (11,&25,&29,&23),\\ (13,&17,&25,&19),\\ (13,&23,&25,&21).\\ \end{eqnarray*} Commented Mar 16, 2021 at 22:57

First of all let (WLOG) $$x>y>z$$.
Let's say that we may assume $$gcd(x,y,z)=1$$. Otherwise if $$x=dX , y=dY , z=dZ , k=dK$$ then we'll have $$X^2+Y^2+Z^2=3K^2$$. Now it is sufficient to prove the claim for the latter equation since :
$$X-Z\geqslant\sqrt{K} \iff dX-dZ\geqslant d\sqrt{K}\geqslant\sqrt{dK} \iff x-z\geqslant\sqrt{k}$$ Now since $$gcd(x,y,z)=1$$ and $$3|x^2+y^2+z^2$$ , one can deduce that $$3\not|xyz$$.
$$(x+y+z)^2+(x-y)^2+(y-z)^2+(x-z)^2=9k^2$$ Let $$x-z=a$$ , $$y-z=b$$ , $$x+y+z=t$$ $$\implies$$ $$x-y=a-b$$ and $$t=3z+(a+b)$$
And the equation will now be: $$a^2+b^2+(a-b)^2=(3k)^2-t^2=(3k-t)(3k+t)$$ Let $$3k+t=\alpha$$ and $$3k-t=\beta$$
Now note that since $$x>y>z$$, we'll have $$a>b$$.
Then one can see that $$\alpha\beta=(a-b)^2+a^2+b^2<2a^2$$. On the other hand clearly since $$\alpha,\beta$$ are positive integers, $$\alpha\beta\geqslant\alpha+\beta-1$$. Therefore, $$2a^2\geqslant\alpha\beta\geqslant\alpha+\beta-1$$. Finally: $$k=\frac{\alpha+\beta}{6}<\frac{2a^2+1}{6} \iff \sqrt{3k-\frac12}