While reading up on Pythagorean quadruples and Legendre's three square theorem, I encountered the following problem:

Since there are an infinite number of Pythagorean quadruples, it is true that the equation $a^2 + b^2 + c^2 = d^2$ has an infinite number of positive integer solutions. For example, $3^2 + 4^2 + 12^2 = 13^2$. In the same sense, we can show that $5^2$ can be written as the sum of two squares $3^2 + 4^2$ and the difference of two other squares $13^2 -12^2$. Using the results above, is it possible to show that any perfect square $k^2$ can be simultaneously written as the sum of two squares $a^2 + b^2$ and the difference of two other squares $d^2 - c^2?$

For a different version of the question, click here: Range of values of $k^2$ equal to the sum of two squares and the difference of two other squares.

  • 2
    $\begingroup$ Changing the nature of a question after it has been answered is bad form, as it makes the answerer appear to have misunderstood what you've asked, so I have rolled the question back to its original form. You should post your revised question separately. (It's free!) ... Also, please be clear in the question whether you are posing a conjecture, a problem of your own devising, etc. It's helpful for answerers to know how open-ended a question might be. $\endgroup$
    – Blue
    May 3, 2020 at 6:46
  • $\begingroup$ Ahh I see sorry then I'll post another question with the edited version. Sorry! $\endgroup$ May 4, 2020 at 12:06
  • 1
    $\begingroup$ No harm done. :) ... You could/should update this question with a link to the new one, and have a link in the new question to this one. This will help move attention off of the old question, provide context for the new question, and avoid possible close-as-duplicate votes from people who don't notice the subtle differences between the two. Cheers! $\endgroup$
    – Blue
    May 4, 2020 at 12:10

3 Answers 3


While obviously, we have $k^2=k^2+0^2 = k^2-0^2$. We might want to exclude it to make things interesting and restrict each term to be non-zero.

In that case, it is not true.

Consider $2^2$, however, we can write it as the sum of two non-zero squares.

Non-zero squares that are smaller than it is $1$, hence it can't be written as the sum of two squares.

Similarly, $1^2=1$ cannot be the difference of two non-zero squares. Suppose $$1=c^2-b^2=(c-b)(c+b)$$

then we have $c-b=1$ and $c+b=1$, resulting in $c=1, b=0$.

Similarly, $2^2=c^2-b^2=(c-b)(c+b)$

Then we either have $(c-b, c+b)=(1,4)$ or $(c-b, c+b)=(2,2)$. The second case would lead to $b=0$. hence just consider the first case.

$$c-b=1$$ $$c+b=4$$

but adding them up would lead to a contradiction in parity.

  • $\begingroup$ Ah that makes sense I should've restricted the values to be nonzero positive integers and completely overlooked k=1 and k=2. Thanks! $\endgroup$ May 3, 2020 at 6:33
  • $\begingroup$ However, if I change the question to what are the set of values of k such that this is true, how would I tackle such a problem? $\endgroup$ May 3, 2020 at 6:38
  • $\begingroup$ I might start from studying Pythagoren triple but I'm not good with those. $\endgroup$ May 3, 2020 at 8:26

"OP" needs solution for below mentioned simultaneous equation:



Take, $(a,b)=[(m^2-n^2),(2mn)]$


Hence, $w^2=(m^2+n^2)^2=(p^2-q^2)^2$

So we impose the condition:


For, $(m,n,p,q)=(12,9,17,8)$ we get:






We have:

$a^2+b^2=w^2$ -----(1)

$c^2-d^2=w^2$ ----(2)


$(a,b)=[(m^2-n^2),(2mn)]$ ----(3)

$(c,d)=[(p^2+q^2),(2pq)]$ ----(4)


$(m^2+n^2)=(p^2-q^2)$ ---------(5)

Parameterizing eqn (5) at,

$(m,n,p,q)=(2,1,3,2)$ we get:


Substituing above value's in (3) & (4) we get:






For, t=3 we get:


Hence simultaneous equation's (1) & (2) have

solution's above without any condition's on

the variables $(a,b,c,d,w)$.


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.