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 *n*th power?


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



$n$ variables Diophantine
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.


