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?

  • $\begingroup$ If you mean ordered solutions, $0 < x < y,$ take $n = 5 \cdot 13 \cdot 17 \cdot 29 $ $\endgroup$
    – Will Jagy
    Commented Aug 20, 2013 at 0:22
  • $\begingroup$ 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. $\endgroup$ Commented Aug 20, 2013 at 0:22
  • $\begingroup$ @WillJagy Do you really need three primes? I think $5\cdot 13\cdot 17$ is enought. $\endgroup$ Commented Aug 20, 2013 at 0:23
  • $\begingroup$ @Thomas, could be. I don't remember whether you double with each prime or just add one. $\endgroup$
    – Will Jagy
    Commented Aug 20, 2013 at 0:24
  • 5
    $\begingroup$ So: $n=5\cdot 13\cdot 17 = 4^2+33^2 = 9^2+32^2 = 12^2+31^2 = 23^2 + 24^2$. $\endgroup$ Commented Aug 20, 2013 at 0:32

1 Answer 1


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.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .