First, you show that you can express all numbers $129$ though something convenient as a sum of distinct squares just by making a list. I will choose $4900$ and assume that we have a list that runs that high. We do the proof by strong induction. Assume that all numbers in the range $[129,k]$ can be expressed as a sum of distinct squares, where $k \ge 4900$. We shall show that $k+1$ can be so expressed. Let $m = \lfloor \sqrt {k+1} \rfloor -1$. We can express $k+1=m^2+p$, where $p \ge 129$, so it can be expressed as a sum of distinct squares. Since $p \lt m^2$, there is no conflict with the new square, and $k+1$ can be expressed as a sum of distinct squares. You could lower the bound of the specific list below $3600$ if you think harder about what square to subtract. I chose $3600$ because the spacing of squares attains $129$ at that point.

Added: the list you make can run only through $[129,297]$. We can be lazier in the first part with more work in the second. $297$ is a risk because $297=169+128$, so the largest square you can subtract and stay larger than $129$ is $144$ and the expression for $153$ could involve $144$. In fact $144+9=153$, but you can also do $100+49+4$. Starting with $298$ you can always subtract a square that leaves at least $129$ and is greater than half the starting number, so the strong induction goes through.

I think we can always translate everything to the basics operations but it will take a huge number of pages! Fortunately, your question has an elementary answer. We denote by $S_n$ the set of representation of the integer $n$ as sum of squares, we have $(a,b)\in S_n$ if and only if $0\leq b<a$ and $ a^2+b^2=n$;

Given two primes $p$ and $q$ let:
$$ S_p=\{(a_p,b_p)\}\\
S_q=\{(a_q,b_q)\}
$$
Now we want to prove that $S_{pq}$ contains exactly two elements, or in other words we want to prove that the following equations on unknown $(a,b),(c,d)$ has exactly one solution :

- $a>b>0$ and $c>d> 0$ (it's clear that neither $d=0$ or $b=0$ occurs)
- $a^2+b^2=c^2+d^2=pq$
- $a>c$ ( different elements)

The equation in the middle is equivalent to:
$$(a-c)(a+c)=(d-b)(d+b)$$
this implies the existence of integers $x,y,z,t$ pairwise coprime such that:
$$\begin{align} a-c&=&2xy\\ a+c&=&2zt\\d-b&=&2xz\\d+b&=&2yt \end{align}$$
Note that the existence is not hard for example $x=gcd\big(\frac{a-c}{2},\frac{d+b}{2}\big),y=gcd\big(\frac{a-c}{2},\frac{d-b}{2}\big)\cdots$, so this will justify also that they are pairwise corprime.

The result is the fact that:
$$pq=(x^2+t^2)(y^2+z^2)$$
obviously $xyzt\neq 0$ therefore $\{p,q\}=\{x^2+t^2,y^2+z^2\}$ we have two cases:

- $p=x^2+t^2$ and $q=y^2+z^2$, because $a+c>d-b$ we have $t>x$, and $a+c > d+b$ implies $z>y$ so $x=b_p,t=a_p,y=b_q, z=a_q$ so $a=a_pa_q+b_qb_p,b=a_pb_q-b_pa_q,c=a_pa_q-b_qb_p, d=a_pb_q+b_pa_q$
- $q=x^2+t^2$ and $p=y^2+z^2$ because of the symetry it gives different $x,y,z,t$ but the same $a,b,c,d$ as the first case.

So there is only one solution to the equations hence $S_{pq}$ contains exactly two elements.

## Best Answer

Some thoughts on this without using complex numbersLet $N=1885$ which can be factorised to give 3 different primes, each of which can be written as the sum of two squares in one way only (i.e. $5=1^2+2^2$,$13=2^2+3^2$ and $29=2^2+5^2$. Notice that 5, 13 and 29 are all of the form $(4n+1)$ ). Therefore $N=xyz$ where $x=\left(r^2+s^2\right)$, $y=\left(t^2+u^2\right)$ and $z=\left(v^2+w^2\right)$

First multiplying x and y we can show that the product equals the sum of two squares in at least two algebraically distinct ways. $$xy=\left(r^2+s^2\right)\left(t^2+u^2\right)=\left(rt+su\right)^2+\left(ru-st\right)^2=\left(rt-su\right)^2+\left(ru+st\right)^2$$ I am not sure how to prove that this represents the maximum number of ways the product can be written distinctly as the sum of two squares. I suppose you need to convince yourself of this before continuing.

In a similar way we can demonstrate that multiplying the product $xy$ by $z=\left(v^2+w^2\right)$ doubles the previous number of algebraic solutions. Therefore we provisionally find that $N$ equals the sum of two square in four algebraically distinct ways.

You then need to make the calculations to see if these four possible algebraic solutions are numerically distinct.