Equation with Vieta Jumping: $(x+y+z)^2=nxyz$.

Find all $n\in\mathbb{N}$ so that there exist $x,y,z\in \mathbb{N}$ that solve: $$(x+y+z)^2=nxyz$$

I tried to attack it finding solutions, but all the solutions doesn't seem to have something in common. For example:

$$(x,y,z,n)=(1,1,1,9)$$ $$(x,y,z,n)=(1,2,3,6)$$ $$(x,y,z,n)=(1,4,5,5)$$ $$(x,y,z,n)=(2,2,4,4)$$ $$(x,y,z,n)=(8,8,16,1)$$

I was trying to solve this problem, but someone told me that a hint to solve it is using Vieta Jumping. I don't know how to use Vieta Jumping, so can anyone help me to understand how to apply Vieta Jumping and solve the problem?

SECOND ANSWER: If all you care about is the values of your letter $n,$ those are $n \leq 9$ but $n \neq 7.$

I do not see how anyone could get this without a copy of Hurwitz 1907 to consult. There is more to it than Vieta jumping, although all ingredients are elementary to confirm once they are pointed out. The end of the thing is that all solutions occur in one of thirteen trees, each with a root called a Grundlösung or fundamental solution. Each tree resembles the Markov Number Tree.

I write $$(x+y+z)^2 = A xyz.$$ A fundamental solution is one for which $$x \geq y \geq z \geq 1,$$ but $x \leq Ayz - 2y - 2z - x,$ or $$2x \leq Ayz - 2y - 2z.$$ That is, the gap $$Ayz - 2y - 2z - 2x \geq 0.$$ We write this as $Ayz - 2 (x+y+z)$ and square it, to get rid of the $x$ eventually. We get $$\left(Ayz - 2 (x+y+z) \right)^2 = A^2 y^2 z^2 - 4Ayz(x +y+z) + 4(x+y+z)^2,$$ $$\left(Ayz - 2 (x+y+z) \right)^2 = A^2 y^2 z^2 - 4Ayz(x +y+z) + 4Axyz,$$ $$\left(Ayz - 2 (x+y+z) \right)^2 = A^2 y^2 z^2 - 4Ayz(y+z).$$ $$\left(Ayz - 2 (x+y+z) \right)^2 = y^2 z^2 \left( A^2 - \frac{4A(y+z)}{yz} \right).$$ Next, we define, as in Hurwitz (9) and (11), $$p_1 = \frac{A(y+z)}{yz} = A \left( \frac{1}{y} + \frac{1}{z} \right),$$ $$p_2 = \frac{A(z+x)}{zx} = A \left( \frac{1}{z} + \frac{1}{x} \right),$$ $$p_3 = \frac{A(x+y)}{xy} = A \left( \frac{1}{x} + \frac{1}{y} \right),$$ with $$p_1 \geq p_2 \geq p_3 > 0.$$ So far $$Ayz - 2 (x+y+z) = yz \sqrt {A^2 - 4p_1},$$ $$Azx - 2 (x+y+z) = zx \sqrt {A^2 - 4p_2},$$ $$Axy - 2 (x+y+z) = xy \sqrt {A^2 - 4p_3}.$$ Thus $$Axyz - 2x (x+y+z) = xyz \sqrt {A^2 - 4p_1},$$ $$Axyz - 2y (x+y+z) = xyz \sqrt {A^2 - 4p_2},$$ $$Axyz - 2z (x+y+z) = xyz \sqrt {A^2 - 4p_3}.$$ Add these three, $$3Axyz - 2 (x+y+z)^2 = xyz \left( \sqrt {A^2 - 4p_1} + \sqrt {A^2 - 4p_2} + \sqrt {A^2 - 4p_3} \right).$$ Let me emphasize this here, we can make a common denominator and get $$\sqrt {A^2 - 4p_1} = A - \frac{2x^2 + 2zx + 2xy}{xyz},$$ $$\sqrt {A^2 - 4p_2} = A - \frac{2y^2 + 2yz + 2xy}{xyz},$$ $$\sqrt {A^2 - 4p_3} = A - \frac{2z^2 + 2yz + 2zx }{xyz}.$$ $$\sqrt {A^2 - 4p_1} + \sqrt {A^2 - 4p_2} + \sqrt {A^2 - 4p_3} = 3 A - 2 \frac{(x+y+z)^2}{xyz} = 3A - 2A = A.$$ Let us call this Hurwitz (13), that $$\sqrt {A^2 - 4p_1} + \sqrt {A^2 - 4p_2} + \sqrt {A^2 - 4p_3} = A.$$ As $$\sqrt {A^2 - 4p_1} \leq \sqrt {A^2 - 4p_2} \leq \sqrt {A^2 - 4p_3},$$ we get $$3 \sqrt {A^2 - 4p_1} \leq A.$$ Square this, call this (14), $$9 A^2 - 36 p_1 \leq A^2,$$ or $8 A^2 \leq 36 p_1.$ Divide by $4,$ $$2A^2 \leq 9 p_1.$$ Recall $$p_1 = A \left( \frac{1}{y} + \frac{1}{z} \right).$$ We get Hurwitz (15), for a fundamental solution, $$2A \leq 9 \left( \frac{1}{y} + \frac{1}{z} \right).$$ As $y \geq z \geq 1,$ the reciprocals are at most $1,$ sum at most $2,$ $2A \leq 18,$ and $$\color{red}{ A \leq 9}.$$ Also, the sum of the two reciprocals is at most $2/z,$ from which we get $$\color{red}{z \leq \frac{9}{A}}.$$

We briefly return to the definition of fundamental, $$2x \leq Ayz - 2 y - 2 z.$$ Multiply through by $x,$ we get $$2x^2 \leq Axyx - 2xy - 2zx,$$ or $$2x^2 \leq (x+y+z)^2 - 2 xy - 2 zx,$$ or $$2x^2 \leq x^2 + y^2 + z^2 + 2 y z.$$ This gives $$x^2 \leq y^2 + 2 yz + z^2.$$ This gives what we could call Hurwitz (16), in a fundamental solution, $$\color{red}{x \leq y+z}.$$ With these inequalities, I have already confirmed things for all $9 \geq A \geq 5.$ Mostly, this gives $z=1,$ so either $x=y$ or $x=y+1,$ and we can finish with the quadratic formula. One little outcome of that is $A \neq 7.$ Now that I look again, the trees on the roots with $9 \geq A \geq 5$ turn out to give all the solutions with $\gcd(x,y,z) = 1;$ good to know.

The fundamental solutions are

1    X:  16    Y:  8    Z:  8
1    X:  18    Y:  12    Z:  6
1    X:  25    Y:  20    Z:  5
1    X:  9    Y:  9    Z:  9
2    X:  8    Y:  4    Z:  4
2    X:  9    Y:  6    Z:  3
3    X:  3    Y:  3    Z:  3
3    X:  6    Y:  4    Z:  2
4    X:  4    Y:  2    Z:  2
5    X:  5    Y:  4    Z:  1
6    X:  3    Y:  2    Z:  1
8    X:  2    Y:  1    Z:  1
9    X:  1    Y:  1    Z:  1
jagy@phobeusjunior:~$ I thought I might draw the beginning of one of the trees, sideways as they do in Wikipedia. Here is$A=9.$As$x,y,z$are pairwise relatively prime and$9$is a square, it is automatic that all entries in the tree are squares. Next day: I wrote a C++ program so that I would not need to copy the numbers by hand from my calculator. From what I can see, I made no errors yesterday... A = 9 841, 187489, 1418727556 25, 841, 187489 25, 187489, 41809156 4, 25, 841 841, 28561, 216119401 4, 841, 28561 4, 28561, 970225 1,1,1---1,1,4---1,4,25 169, 37636, 57168721 25, 169, 37636 25, 37636, 8392609 1, 25, 169 169, 1156, 1755625 1, 169, 1156 1, 1156, 7921  I did another one, here is$A=8.$This time, the pairwise gcd's are stil$1,$but the product is double a square, so the entries are either square or twice squares. Note that the "trunk" is shorter this time, as the root has only two entries equal, not all three. A = 8 121, 8450, 8162449 9, 121, 8450 9, 8450, 591361 2, 9, 121 121, 1681, 1623602 2, 121, 1681 2, 1681, 23409 1, 1, 2----1, 2, 9 50, 3481, 1385329 9, 50, 3481 9, 3481, 243602 1, 9, 50 50, 289, 114921 1, 50, 289 1, 289, 1682  With$A=6,$each triple is a square, twice a square, and three times a square. A = 6 25, 392, 57963 3, 25, 392 3, 392, 6241 2, 3, 25 25, 243, 35912 2, 25, 243 2, 243, 2401 1, 2, 3 8, 121, 5547 3, 8, 121 3, 121, 1922 1, 3, 8 8, 27, 1225 1, 8, 27 1, 27, 98  With$A=5$each triple is a square, another square, and five times a square. A = 5 81, 1849, 744980 5, 81, 1849 5, 1849, 42436 4, 5, 81 81, 1445, 582169 4, 81, 1445 4, 1445, 25921 1, 4, 5 9, 196, 8405 5, 9, 196 5, 196, 4489 1, 5, 9 9, 20, 841 1, 9, 20 1, 20, 49  • Very interesting,$+1$. – Dietrich Burde Sep 18 '16 at 7:31 • Very understandable, but, I don't know how you got the equality$(Ayz-2(x+y+z))^2=(Ayz)^2-4Ayz(y+z)$, can you explain me that point? – MonsieurGalois Sep 18 '16 at 15:58 Besides Vieta jumping one can successfully use Pell's equation. For$n=1$this is demonstrated here, giving infinite families of solutions. This may work for other$n$, too. The author, Titu Andreescu, has written several notes on such Diophantine equations. If you search his articles, in particular on quadratic Diophantine equations, there are more references. Remark: For Vieta jumping, for the different equation$x^2+y^2+z^2=nxyz$, see this question on MSE. • This problem follows Hurwitz 1907 much more closely than I could have expected. Very long if written out completely, of course. There is a treatment with coefficient$1$in a book by Andreescu and Andrica, I think they miss some stuff. – Will Jagy Sep 17 '16 at 21:44 Fair to say this one is difficult; a full proof would need everything in HURWITZ 1907. Each fundamental solution is given as$x \geq y \geq z \geq 1,$with $$nyz - 2y- 2z \geq 2x,$$ or $$2(x+y+z) \leq nyz.$$ Each fundamental solution is the base of an infinite tree of solutions; given$(n;x,y,z),$we get three solutions $$(n; \; \; nyz - 2y- 2z-x, \; \; y, \; \; z),$$ $$(n; \; \; x, \; \; nzx - 2z- 2x-y, \; \; z),$$ $$(n; \; \; x, \; \; y, \; \; nxy - 2x- 2y-z).$$ The trees are quite similar to the Markov NumberTree The fundamental solutions are 1 X: 16 Y: 8 Z: 8 1 X: 18 Y: 12 Z: 6 1 X: 25 Y: 20 Z: 5 1 X: 9 Y: 9 Z: 9 2 X: 8 Y: 4 Z: 4 2 X: 9 Y: 6 Z: 3 3 X: 3 Y: 3 Z: 3 3 X: 6 Y: 4 Z: 2 4 X: 4 Y: 2 Z: 2 5 X: 5 Y: 4 Z: 1 6 X: 3 Y: 2 Z: 1 8 X: 2 Y: 1 Z: 1 9 X: 1 Y: 1 Z: 1 jagy@phobeusjunior:~$


Notice how, for each $n > 1,$ we can create a solution with $n=1,$ from $(n;x,y,z)$ to $(1,nx,ny,nz).$ This may help proving something, as we may demand $(1;a,b,c)$ and hope to prove the list full.