Representation as a sum of two squares Recently, I have been wandering that what natural numbers can can be written as a sum of squares of two coprime positive integers in two different ways, order being irrelevant, or with the help of notations, 

Find all natural numbers $a,b,c,d,n$ such that $$n=a^{2}+b^{2}=c^{2}+d^{2}$$ where gcd$(a.b)$$=$gcd$(c,d)$$=1$ and $a\lt c \lt d \lt b$.

My little progress: The prime decomposition of $n$ must look like $2^{a_1}p_2^{a_2}...p_r^{a_r}$ where $a_1 \in \{0,1\}$ and the $p_i$ 's are primes of the form $4k+1$. 
Proof: Suppose there existed a prime $p \equiv 3 \pmod 4$ in the prime decomposition of $n$, then we would have $a^2+b^2 \equiv 0 \pmod p$. But then we would have $a\equiv b \equiv 0 \pmod p$, contradicting gcd$(a,b)$$=1$ (For , if $a \not \equiv 0 \pmod p$, then $(a,p)=1$ and hence $\exists c$ such that $ac \equiv  1 \pmod p$ wherefrom we see that $(ac)^2+(bc)^2 \equiv 0 \pmod p$ and the contradiction $1+(bc)^2 \equiv 0 \pmod p$).
Also, if $4|n$, then gcd$(a,b)$$=1$ forces us to conclude that both $a$ and $b$ are odd but then $0 \equiv a^2+b^2 \equiv 2 \pmod 4$. Contradiction!
 A: We give an answer to a generalization of the problem, but without proof. The easiest proof uses facts about the factorization of Gaussian integers.
Note that if $n$ is divisible by $4$ or by a prime of the form $4k+3$, then $n$ has no representation as a sum of relatively prime squares. So we can assume that $n$ is of the form $n=p_1^{a_1}p_2^{a_2}\cdots p_s^{a_s}$ or $n=2p_1^{a_1}p_2^{a_2}\cdots p_s^{a_s}$. where the $p_i$ are distinct primes all of the form $4k+1$.
Let $n\gt 2$. Then the number of essentially distinct representations of $n$ as a sum of two relatively prime squares is $2^{s-1}$. In particular, $n$ has exactly $2$ essentially distinct representations as a sum of two relatively prime squares if and only if $s=2$.  
A: We have
$$65=1^2+8^2=4^2+7^2.$$
I chose this number because it is a product of two different prime numbers ($5$ and $13$) that are each congruent to $1$ mod $4$ (hence each expressible as a sum of two different squares); indeed, $65$ is the smallest such number.
You can also see that
$$85=5\cdot 17=2^2+9^2=6^2+7^2$$
$$221=13\cdot 17=5^2+14^2=10^2+11^2$$
I haven't quite thought about which other numbers might be able to be expressed this way, but I am pretty sure that some simple manipulations with Fermat's two-squares theorem (Wikipedia) will show that any product of two different primes each congruent to $1$ mod $4$ is expressible this way. (I have to go to class now, so I can't do those manipulations myself right now.)
