How many integers less than $1000$ can be expressed in the form $\frac{(x + y + z)^2}{xyz}$?

How many integers less than $1000$ can be expressed in the form $$\frac{(x + y + z)^2}{xyz}$$ where $x, y, z$ are positive integers?


You need to check if the question restricted to only positive integers $x, y, z$, otherwise it is quite trivial to get any desired number.

For zero, take $x = 2, y =-1, z = -1$.

For any positive number $N$, take $x = -N, y = 1, z = -1$.

For any negative number $-N$, take $x = N, y = 1, z = -1$. Clearly all negative numbers are less than $1000$, so you have an infinite number of them.


Added for the revised question with only positive $x, y, z$.

WLOG, we can assume $x \ge y \ge z$. From all such triples which satisfy $\displaystyle \frac{(x+y+z)^2}{xyz} = n$, where $n$ is a fixed positive integer, choose the triple $(a, b, c)$ with the minimum first component. Now we have the quadratic $$x^2 +(2(b+c)- nbc)x + (b+c)^2 = 0 \tag{1}$$ for which $a$ is a root, and let the other root be $\alpha$. As $a \alpha = (b+c)^2$, $\alpha > 0$, and from our choice of triple, $\alpha \ge a \ge b \ge c$.

We have $(b+c)^2 = \alpha \,a \ge \alpha (b+c)/2 \implies \alpha \le 2(b+c)$.
Also we have $a^2 \le a\alpha = (b+c)^2$, so $a \le b+c$. Using these in the formula for sum of roots, $nbc - 2(b+c) = \alpha+a \le 3(b+c)$ gives $n bc \le 5(b+c)$. As $b, c$ are positive integers, $$\implies n \le 5\left(\frac1c + \frac1b\right) \le 10 \tag{2}$$

This gives us a bound to restrict our search. It is easily observed that for $n = 10$, the bound $(2) \implies b = c = 1$, which leads to the quadratic $(1): x^2 -6x+4=0$ which does not have integer roots.

A quick search (well it was quick in Mathematica) yields solutions for $n = 1, 2, 3, 4, 5, 6, 8, 9$ - for e.g. in order, $(9, 9, 9), (9, 6, 3), (3, 3, 3), (4, 2, 2), (9, 5, 1), (3, 2, 1), (2, 1, 1), (1, 1, 1)$.

For $n=7$, we have $(2) \implies \frac75 \le \frac1b + \frac1c$, for which the only ordered positive integer solutions possible are $b=c=1$ and $b=2, c=1$. In the first case we have the quadratic $x^2 - 3x + 4=0$ which has no real roots, and the second case gives the quadratic $x^2 - 8x + 9 = 0$, which has no integer roots.

Hence there are only $8$ possible integers that can be expressed as desired.