# $n$ variables Diophantine

Let $$n \ge 2$$ be a positive integer. Do there exist $$n$$ non-zero distinct integers such that the sum of their square is a perfect square and their product is a nth power?

For $$n=2$$ the answer is no, by infinite descent. Is this true for all $$n$$? What happens for other values of $$n$$?

• There are solutions at least for $n=3,4,5$: for $n=3$, we have $$(4,9,48;49,12), (3,36,128; 133,24), (56,72,147; 173,84)$$ and no other primitive examples up to $200$; for $n=4$, $$(2,25,50,64;85,20), (4,30,75,90;121,30), (6,20,75,90;119,30), (10,30,36,75;89,30), (15,18,30,100;107,30)$$ and no others through $100$; and for $n=5$, $$(3,4,12,24,72;77,12), (3,24,36,48,64;91,24)$$ and no others through $100$. – Noam D. Elkies Jan 30 at 15:12
• . . . and for $n=6$ the first solution is $(15, 20, 25, 27, 45, 80; 102, 30)$ (it took about 3 minutes to try all sextuples up to $81$). – Noam D. Elkies Jan 30 at 15:20
• n=7 36 24 18 16 9 8 2 sumsquares 3^2 17^2 prod 2^14 3^7 – Will Jagy Jan 30 at 19:41
• n=8: (5, 25, 27, 30, 36, 40, 60, 75; 120, 30)  There are solutions for each $n>2$; I should be able to post an answer later today if nobody else does it first. – Noam D. Elkies Jan 31 at 17:13
• meanwhile, for n=9: $(5, 6, 8, 10, 30, 75, 120, 135, 225; 300, 30)$ – Noam D. Elkies Jan 31 at 20:56

There are such solutions for each $$n>2$$.

We seek distinct nonzero integers $$x_1,\ldots,x_n$$ such that $$\sum_{i=1}^n x_i^2 = y^2$$ and $$\prod_{i=1}^n x_i = z^n$$. These equations are homogeneous, so it is enough to consider the distinct nonzero rationals $$r_i := x_i / z$$, which satisfy $$\sum_{i=1}^n r_i^2 = (y/z)^2$$ and $$\prod_{i=1}^b r_i = 1$$: given distinct nonzero rationals $$r_1,\ldots,r_n$$ with $$\prod_{i=1}^n r_i = 1$$ such that $$\sum_{i=1}^n r_i^2 = \eta^2$$ for some rational $$\eta$$, we can clear common factors to recover an integer solution $$x_1,\ldots,x_n$$.

Now if we fix $$n-2$$ of the $$r_i$$, say $$r_3,\ldots,r_n$$, then the remaining two (here $$r_1,r_2$$) together with $$\eta$$ satisfy the equations $$r_1 r_2 = \prod_{i=3}^n r_i^{-1}, \quad r_1^2 + r_2^2 + \sum_{i=3}^n r_i^2 = \eta^2,$$ which give an elliptic curve. So, once we have a single "random" solution $$(r_1,\ldots,r_n,\eta)$$, we get a pair $$(r_1,r_2,\pm\eta)$$ of rational points on that elliptic curve, the group law to get infinitely many others with the same $$r_3,\ldots,r_n$$; we can then start from any of those points, switch to another elliptic curve and use its group law, etc. until we get a "Zariski-dense" set of rational points on the variety $$\prod_{i=1}^n r_i = 1, \sum_{i=1}^n r_i^2 = \eta^2$$. In particular, we'll find solutions with distinct $$r_i$$. even if our initial solution had some coincidences. For example, if $$n=4$$ we can start from $$(1/2,1,1,2;5/2)$$, fix $$(r_3,r_4)=(1,2)$$, and solve for $$r_2$$ to get $$r_2 = 1/(2r_1)$$, getting the elliptic curve $$4r_1^4 + 20 r_1^2 + 1 = s^2$$ (where $$s = 2r_1\eta$$). The osculating parabola at $$(r,s) = (1/2,5/2)$$ is $$s = (166 r_1^2 + 384 r_1 + 79) / 125$$, giving the new solution $$r_1 = 391/182$$ and then $$(r_1,r_2,r_3,r_4;\eta) = (391/182, 91/391, 1, 2; 221285/71162)$$ which scales to the integer solution $$(152881, 16562, 71162, 142324; 221285, 71162)$$ with distinct variables.

So it remains to find a starting solution for each $$n>2$$. There are already examples for $$3 \leq n \leq 9$$ in the comments:

n  r1, ..., rn; eta
3  1/3, 3/4, 4; 49/12
4  1/10, 5/4, 5/2, 16/5; 16/5
5  1/4, 1/3, 1, 2, 6; 77/12
6  1/2, 2/3, 5/6, 9/10, 3/2, 8/3; 17/5
7  1/6, 2/3, 3/4, 4/3, 3/2, 2, 3; 17/4  [W. Jagy]
8  1/6, 5/6, 9/10, 1, 6/5, 4/3, 2, 5/2; 4
9  1/6, 1/5, 4/15, 1/3, 1, 5/2, 4, 9/2, 15/2; 10


To go further, we search for rational $$r_1,\ldots,r_7$$, not necessarily distinct, such that $$\prod_{i=1}^r r_i = 1$$ and $$\rho := \sum_{i=1}^r r_i^2$$ is an integer (not necessarily a square); $$7$$ was the first to easily give plentiful choices:

rho  r1, ..., r7
---  ----------------
10  1/3, 5/6, 5/6, 6/5, 3/2, 3/2, 8/5
12  1/6, 5/6, 6/5, 3/2, 3/2, 8/5, 5/3
13  1/6, 2/3, 4/3, 3/2, 3/2, 3/2, 2
15  1/6, 5/6, 9/10, 6/5, 4/3, 2, 5/2
16  1/10, 5/6, 4/3, 4/3, 3/2, 9/5, 5/2
17  1/6, 2/3, 9/10, 6/5, 4/3, 5/2, 5/2
18  1/6, 1/3, 3/2, 3/2, 3/2, 2, 8/3
19  4/15, 1/2, 2/3, 5/6, 2, 5/2, 27/10
20  3/10, 2/5, 5/6, 5/6, 3/2, 8/3, 3
21  4/15, 1/2, 2/3, 2/3, 5/2, 5/2, 27/10
22  1/6, 1/3, 9/10, 6/5, 5/2, 5/2, 8/3


We can now mix and match these $$r_1,\ldots,r_7$$ together with some $$r_i=1$$ to find an initial solution for each $$n>9$$. For $$n=10$$, take the $$\rho=22$$ solution with $$r_8=r_9=r_{10}=1$$ to make $$\sum_{i=1}^{10} r_i^2 = 25$$; likewise for $$n=11,12,13,\ldots,17$$ with $$\rho = 25 + 7 - n$$; then for $$n=18$$ use the $$\rho=10$$ and $$\rho=22$$ sets with $$r_{15}=r_{16}=r_{17}=r_{18}=1$$ to make $$\sum_{i=1}^{10} r_i^2 = 36$$; for the next few $$n$$, change $$\rho=22$$ to $$\rho=21,20,19,\ldots$$; as $$n$$ increases further, move up to $$\sum_{i=1}^n r_i^2 = 49$$, $$64$$, $$81$$, etc. There are more than enough options to get a starting solution for each $$n$$, and then the elliptic-curve technique does the rest.

• Thanks, Noam. .. – Will Jagy Feb 1 at 22:07
• @NoamD.Elkies Thank you. – jack Feb 2 at 21:03