Natural number which can be expressed as sum of two perfect squares in two different ways?

Ramanujan's number is $1729$ which is the least natural number which can be expressed as the sum of two perfect cubes in two different ways. But can we find a number which can be expressed as the sum of two perfect squares in two different ways. One example I got is $50$ which is $49+1$ and $25+25$. But here second pair contains same numbers. Does any one have other examples ?

$$65 = 64 + 1 = 49 + 16$$

This will work for any number that's the product of two primes each of which is congruent to $1$ mod $4$. For more than two ways multiply more than two such primes.

Note that $a^2 + b^2 = c^2 + d^2$ is equivalent to $a^2 - c^2 = d^2 - b^2$, i.e. $(a-c)(a+c) = (d-b)(d+b)$. If we factor any odd number $m$ as $m = uv$, where $u$ and $v$ are both odd and $u < v$, we can write this as $m = (a-c)(a+c)$ where $a = (u+v)/2$ and $c = (v-u)/2$. So any odd number with more than one factorization of this type gives an example.

Thus from $m = 15 = 1 \cdot 15 = 3 \cdot 5$, we get $8^2 - 7^2 = 4^2 - 1^2$, or $1^2 + 8^2 = 4^2 + 7^2$.

From $m = 21 = 1 \cdot 21 = 3 \cdot 7$ we get $11^2 - 10^2 = 5^2 - 2^2$, or $2^2 + 11^2 = 5^2 + 10^2$.

• For another example, instead of $m$ odd, we can take $m$ as a multiple of $8$. Then $m$ can again be written as a product $m=uv$ where $u$ and $v$ has the same parity, in two ways. For $m=40$, for example, first $$m=40=4\cdot 10=(7-3)(7+3)=7^2-3^2$$ and secondly $$m=40=2\cdot 20=(11-9)(11+9)=11^2-9^2$$ and we get the example $$7^2+9^2=3^2+11^2.$$ – Jeppe Stig Nielsen Mar 10 '18 at 20:17

The following example easily generalizes:

\begin{align} 5&=(2+i)(2-i)=4+1\\ 13&=(3+2i)(3-2i)=9+4\\ 5\cdot13&=((2+i)(3+2i))((2-i)(3-2i))=(4+7i)(4-7i)=16+49\\ &=((2+i)(3-2i))((2-i)(3+2i))=(8-i)(8+i)=64+1 \end{align}

Well, as I much as I can think of, we have at least one class of examples in $$\boxed{125k^2=(11k)^2+(2k)^2=(10k)^2+(5k)^2} \,\,\,\,\,\,\,\,\, \text{for } \,\,\,\, k\in \mathbb{N}$$

There are many numbers that can be expressed as the sum of two squares in more than one way. For example, $$65=64+1 =49+16$$ $$85=81+4 =49+36$$ $$125=121+4 =100+25$$ $$130=121+9 =81+49$$ $$145=144+1 =64+81$$ $$170=169+1 =121+49$$ $$185=169+16 =121+64$$ and so on... You can also read this PDF for more details. Hope it helps.

• Why do You write the number? If there are so many good formulas. – individ Dec 22 '16 at 5:27
• Are all these numbers expressible as the sum of two squares in two different ways divisible by $5$? (Oh jeez, that question would not be great to ask in one breath.)..... Edit: Nope, because $5\nmid 629$. – Mr Pie Feb 25 '18 at 10:54

You can just multiply any number with a constant, you will get another such numbers. e.g- $65=8^2+1^2=7^2+4^2$.
If you multiply $8$,$1$,$7$ and $4$ with a constant $k=2$ or any other number you will get another number which can be expressed as sum of two squares in two different ways.
Here, A new number formed such that -
$16^2+2^2=14^2+8^2$=$260$

I too got one, but without the above proof. 629 = 23^2 + 10^2 = 25^2 + 2^2

• Put a dollar sign $\$$at the beginning and end of your equation to form the following:$$629 = 23^2 + 10^2 = 25^2 + 2^2.$$By the way, it is also equal to$9^3 - 10^2$and just one off$14^3 - 46^2$(fun fact). – Mr Pie Feb 25 '18 at 10:56 In the same way we can also write 650 as the sum of the squares of two prime numbers in two different ways i.e$650=11^2+23^2=17^2+19^2$since$19^2-11^2=23^2-17^22465$can be expressed as the sum of two squares in four different ways:-$8^2 + 49^2$,$16^2 + 47^2$,$23^2 + 44^2$and$28^2 + 41^2\$.

• Why the two downvotes? This answer seems fine...what am I missing?! – user1729 Mar 5 '18 at 14:45

Product of any two primes of the type (4k+1) will do the trick.. Product of any three primes of the type (4k+1) and you have 4 different ways etc..

Basically - (all easy to prove) A prime of the type p=(4k+1) has unique $$a^2+b^2 = p$$ solution. (Proven by Fermat) A prime of the type p= 4k+3 has NO solution. And for a product of two primes, say $$p=a^2+b^2$$, and $$q= c^2+d^2$$, we have,

$$pq = (ac+bd)^2+(ad-bc)^2 = (ac-bd)^2 +(ad+bc)^2$$ .

• Please use MathJax to format. – Saad Jan 12 at 3:15

The lowest integer that is the sum of two integer squares in two different ways is 50, but that case involves one repeat number 5^2 + 5^2 = 25 + 25 = 50 = 7^2 + 1. The lowest integer that is the sum of two integer squares in two different ways with all different numbers is 65. The lowest integer that is the sum of THREE integer squares in three different ways is 325. The lowest number that is the sum of FOUR integer squares in four different ways is 1105. Interestingly, the lowest integer that is the sum of SIX integer squares in six different ways is lower than the lowest integer that is the sum of FIVE integer squares in five different ways (you can work all these out for yourselves !).