If $n = a^2 + b^2 + c^2$ for positive integers $a$, $b$,$c$, show that there exist positive integers $x$, $y$, $z$ such that $n^2 = x^2 + y^2 + z^2$.

I feel that the problem basically uses algebraic manipulation even though it's in a Number Theory textbook. I don't realize how to show $(a^2+b^2+c^2)^2$ as the sum of three squares. I have tried algebraic manipulation but this is the stage I have reached.

$$(b^2 + c^2)^2 + a^2(a^2 + b^2 + c^2 + b^2 + c^2)$$

Could you give me some hints on how to proceed with this question?


  • $\begingroup$ Well it is obvious if you use the Legendre result that we can represent a number as the sum of three squares unless it is of the form $4^a(8b+7)$. $\endgroup$
    – almagest
    Commented Apr 6, 2016 at 11:43
  • $\begingroup$ @almagest: You should be careful here. Your cited result includes representations, where one or two summand can be zero, i.e. $4=2^2+0^2+0^2$. Hence it does not say anything of being the sum of three positive squares. $\endgroup$
    – MooS
    Commented Apr 6, 2016 at 11:46
  • $\begingroup$ @MooS Good point, anyway individ has come up with a much simpler solution. $\endgroup$
    – almagest
    Commented Apr 6, 2016 at 11:50
  • $\begingroup$ @almagest: According to J.P. Serre (french as well as Legendre) this theorem was discovery by the german Gauss. (p.79 Cours d'Arithmétique. Presses Universitaires de France, 1970). Best regards. $\endgroup$
    – Piquito
    Commented Apr 6, 2016 at 12:16

3 Answers 3









  • $\begingroup$ Why the downvotes? I am not able to find a fault. $\endgroup$ Commented Apr 6, 2016 at 11:48

This can be generalized a bit. it happens that every positive integer $n$ is the sum of four squares, $n = A^2 + B^2 + C^2 + D^2.$ The we get, from manipulating quaternions with integer coefficients, $$ n^2 = (A^2 + B^2 - C^2 - D^2)^2 + (-2AC +2BD)^2 + (-2AD-2BC)^2 $$



I rewrote the version I had to agree with the Euler four square formula in the beginning of the Wikipedia article, with substitutions $$ a_1 = A, b_1 = A, a_2 = B, b_2 = B, a_3 = C, b_3 = -C, a_4 = D, b_4 = -D $$ so that the second of the four terms cancels out to zero. I think this formula is associated with Lebesgue, let me see if i can find that. It plays a big part in Jones and Pall (1939).

Yes, https://en.wikipedia.org/wiki/Pythagorean_quadruple

Well, I requested the 1951 number theory book by Trygve Nagell, evidently it is one source of the idea that Lebesgue was involved.

Hmmm; Euler's four square identity 1748, then Lagrange four square theorem 1770, then Hamilton invents quaternions 1843. The (Henri) Lebesgue we know about lived 1875-1941.

NO, on page 266 of Volume II of Dickson's History of the Theory of Numbers, we find the statement that one V. A. Lebesgue, in 1874, proved the the square of a sum of three squares is again the sum of three squares in a nontrivial manner, as $$ (\alpha^2 + \beta^2 + \gamma^2)^2 = (\alpha^2 + \beta^2 - \gamma^2)^2 + (2\alpha \gamma)^2 + (2 \beta \gamma)^2. $$ This is formula (4) on that page.

Who is V. A. Lebesgue?

Victor-Amédée Lebesgue, sometimes written Le Besgue, (2 October 1791, Grandvilliers (Oise) – 10 June 1875, Bordeaux (Gironde)) was a mathematician working on number theory.

Evidently the precise reference is V. A. Lebesgue, Sur un identite qui conduit a toutes les solutions de l'equation $t^2 = x^2 + y^2 + z^2,$ Compte Rendus de l`Academie des Sciences de Paris 66 (1868), 396-398.

A 1962 article by Spira gives a short elementary proof that all primitive solutions can be found using this formula. He says that the first correct proof of such completeness was Dickson in 1920, with another by Skolem in 1941. Spira adapts the proof of Skolem to give an algorithm for finding at least one set $A,B,C,D$ from a given primitive Pythagorean quadruple.


A theoretical and easy proof for $n$ odd.

According to a theorem of Gauss the positive integer $n$ is a sum of three squares if and only if $n$ is not of the form $4^a(8b-1)$; $a,b\in \mathbb Z$.

If $n^2=8B-1$ then $n^2\equiv -1 \pmod8$. This is not possible because $-1$ is not a square modulo $8$.

Thus the odd integer $n^2$ is always a sum of three squares, in particular when $n$ is itself a sum of three squares.

It should not be very hard the proof for n even, but I do not try because the constructive and nice proof of @individ above.

  • 2
    $\begingroup$ The integer $n^2$ is always a sum of three squares: it is $n^2 + 0^2 + 0^2$. But the theorem of Gauss does not guarantee that $n^2$ is a sum of three positive squares. $\endgroup$ Commented Jan 14, 2020 at 15:45

You must log in to answer this question.

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