How to find numbers like 174 We know Ramanujan number:
$1729 = 1^3+12^3 = 9^3+10^3$
The smallest number expressible as the sum of cubes of two positive integers in two different ways.
We also know how to find other Ramanujan numbers:
$n^3 +(12n)^3 = (9n)^3 + (10n)^3$
In the same way, I want to find $174$
$$\begin{align*} 174
&=1^2+2^2+5^2+12^2\\
&=1^2+3^2+8^2+10^2\\
&=1^2+4^2+6^2+11^2\\
&=2^2+5^2+8^2+9^2\\
&=3^2+4^2+7^2+10^2\\
&=5^2+6^2+7^2+8^2\\
\end{align*}$$
Thus $174$ is the smallest number which can be expressed as the sum of squares of $4$-different integers in $6$ different ways.
How can I find such numbers and don't want to miss any number?
Any algorithm/logical idea is welcome.
 A: There's a lot you could throw at it actually. Some of these include :
$$y=mx+b\land p\mid m, p\in \mathbb{P} \implies y^p\equiv b^p\pmod {pm}$$
$$y=a^2+b^2+c^2+d^2\implies a\leq b\leq c\leq d$$
The fact that distinct $(a,b,c,d)$ for each sum is only possible above $576=24^2$ because there will be $24$ squares involved. Any with duplicates are based on numbers representable as a sum of $3$ or fewer squares.
If $(a,b,c,d)$ have a pair that form two lower legs of a Pythagorean triple then the current number plus a square will always have at least $1$ representation as $4$ squares
If $(a,b,c,d)$ works then $x^2(a,b,c,d)$ is a representation for a multiplier that's square. Therefore, we can reduce the search to square-free numbers  somewhat, because if the radical of $\frac{n}{p}$  works, then it's sufficient to show $np$ has at least as many as required , we just need to rule out it having too many.
Another avenue is looking at the product of two numbers that are a sum of two squares. It always has a representation with four squares.
