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!

  • $\begingroup$ Changing the question after an answer's posted isn't so nice. You can always add a question though. $\endgroup$ – Zev Chonoles Feb 21 '14 at 15:09
  • $\begingroup$ I am sorry @ZevChonoles, actually I wanted this question to be answered and expected it to be in the negative. It is my bad that I should have experimented, nonetheless I've upvoted you. $\endgroup$ – Indrayudh Roy Feb 21 '14 at 15:14
  • $\begingroup$ The condition that you give is required for any number to be representable as a sum of squares of coprime positive integers in just one way itself! $\endgroup$ – Singhal Feb 21 '14 at 15:18
  • $\begingroup$ Yeah, I've seen that. $\endgroup$ – Indrayudh Roy Feb 21 '14 at 15:20

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$.

  • $\begingroup$ Is there any elementary proof of this fact...because I know nothing about the Gaussian integers. $\endgroup$ – Indrayudh Roy Feb 22 '14 at 16:01
  • $\begingroup$ Yes, there is nothing very hard about it, but it takes some writing to put the pieces together. In teaching elementary number theory, I have sometimes given both proofs. $\endgroup$ – André Nicolas Feb 22 '14 at 16:35
  • $\begingroup$ You are free to give me any hints, so I can try by myself, only hints please. $\endgroup$ – Indrayudh Roy Feb 22 '14 at 16:39
  • $\begingroup$ It is far too long. A useful device for producing a representation of $xy$ from representations of $x$ and $y$ is the easily verified identity $(a^2+b^2)(c^2+d^2)=(ac+bd)^2 +(ad-bc)^2$. $\endgroup$ – André Nicolas Feb 22 '14 at 16:44
  • $\begingroup$ But that does not guarantee coprimality...for if $a,b,c,d$ are all odd then both $ac+bd$ and $ad-bc$ are even. $\endgroup$ – Indrayudh Roy Feb 22 '14 at 16:48

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.)

  • $\begingroup$ sent you nice short article on this from the MAA Monthly $\endgroup$ – Will Jagy Feb 21 '14 at 16:12
  • 1
    $\begingroup$ @Will: Thanks for the interesting read :) $\endgroup$ – Zev Chonoles Feb 22 '14 at 23:10
  • $\begingroup$ Probably this jstor.org/stable/40391253 . $\endgroup$ – lhf Jun 10 '16 at 1:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.