# About the solutions of a Diophantine equation

Is there any $n$ such that the equation $n = x^2 + y^2$ ($n, x, y$ belonging to the set of natural numbers) has more of three solutions?

• If you mean ordered solutions, $0 < x < y,$ take $n = 5 \cdot 13 \cdot 17 \cdot 29$ Commented Aug 20, 2013 at 0:22
• Depends on how you are counting - are $(x,y)=(5,0)$ and $(x,y)=(0,5)$ different answers for $n=25$ The answer, however is use, for "more than $k$" for any $k$. In particular, there are cases where there are more than $3$ solutions. Commented Aug 20, 2013 at 0:22
• @WillJagy Do you really need three primes? I think $5\cdot 13\cdot 17$ is enought. Commented Aug 20, 2013 at 0:23
• @Thomas, could be. I don't remember whether you double with each prime or just add one. Commented Aug 20, 2013 at 0:24
• So: $n=5\cdot 13\cdot 17 = 4^2+33^2 = 9^2+32^2 = 12^2+31^2 = 23^2 + 24^2$. Commented Aug 20, 2013 at 0:32

All natural numbers $n=p_1^{e_1}p_2^{e_2}\cdots p_r^{e_r}$ with primes $p_i\equiv 1(4)$ for all $i$ and $B:=(e_1+1)(e_2+1)\cdots (e_r+1)\ge 8$ have at least $4$ different representations as sum of $2$ squares, in fact $B/2$ different representations, if $B$ is even, or $(B-1)/2$ if $B$ is odd. Of course, there are other $n$ with that property as well. So far, this was more or less said already in the comments. However, if you are interested on how to obtain these representations computationally, then you might want to see this discussion here: https://mathoverflow.net/questions/29644/enumerating-ways-to-decompose-an-integer-into-the-sum-of-two-squares.