# It is possible to show square as sum n distinc squares, where n > 2?

We know that $5^2 = 3^2 + 4^2$. But it is possible to show $a^2$ as the sum of three or more distinct squares?

Something like that exist? $a^2 = b^2 + c^2 + d^2$, where $b$, $c$, $d$ are distinct natural numbers.

Thanks a lot!

• $a^2=1^2+1^2+\cdots+1^2$ is one way. If $a\geq 2$, you can swap four of the $1$'s for a $2$. Likewise for $3$, $4$, or any other number. Oct 27, 2014 at 14:30
• It is possible to solve any such equation. Even set some conditions. Only question is, what exactly should be sought. math.stackexchange.com/questions/514075/… Oct 27, 2014 at 15:03

Legendre's three-square theorem states that every number that is not of the form

$$4^n(8m+7)$$

can be written as a sum of exactly three squares. Since most (all?) squares are not of this form, the answer to your question is Yes.

• Yep, all of them. Easy to show that for negative values of n this term can't be an integer. For positive values of n the term $4^n$ is a square number, hence $8m+7$ has to be a square number which is not possible. Oct 27, 2014 at 14:53

The complete solution for your particular case ($n=3$) was given by Catalan — just about any elementary number theory text will give the general integer parameterization of the primitive solutions, which [assuming $b$ is odd] is \begin{align} a &= p^2+q^2+r^2+s^2, \\ b &= p^2+q^2-r^2-s^2, \\ c &= 2(ps+qr), \\ d &= 2(pr-qs). \end{align}

The complete answer for any $n \ge 2$ is given in several papers. A good introduction is Bradley’s paper Equal Sums of Squares. For a more technical matrix-based approach, read Barnett and Mendel’s paper On Equal Sums of Squares.

• Those references are excellent. How did you know about those? Aug 24, 2019 at 1:10
• @AmateurMathPirate: ESOS equations have been a focus of mine for over a decade. Aug 24, 2019 at 16:56

Yes, they do exist! An example is $$(2, 3, 6, 7)$$. $$\sqrt{2^2+3^2+6^2}=7$$. These are called Pythagorean quadruples. They exist in the form $$(a,b,c,d)$$. There is a Wikipedia artible about this: click here.

A Pythagorean quadruple is mostly used to calculate the space diagonal ($$d$$) of a cuboid, which is equal to $$\sqrt{a^2+b^2+c^2}$$, where $$|a|$$, $$|b|$$ and $$|c|$$ are the length, width and height of the cuboid. Here is an example:

(source: smpn1bontang.org)

$$QW$$ is the space diagonal, which is equal to $$\sqrt{PS^2+RS^2+WS^2}$$

• You have a typo - should be $3^2$, not $3^3$. Oct 27, 2014 at 14:56
• Sorry, didn't see that. Thanks for the notification! Oct 27, 2014 at 14:57