# Expressing integers as a sum of squares

There have been many results about the number of squares needed to represent a positive integer. Lagrange's four-square theorem tells us that $4$ squares suffice for any integer and there have been results showing when you can do better than that.

What I'm interested in is why people consider these results interesting.

I can think of one interesting question that relates to these results. If we are allowed to construct lengths by drawing lines with integer lengths and making right-angled triangles out of them to construct new lengths the above theorem tells us that it is always possible to construct a line of length $\sqrt n$ (for any natural number $n$) and it is always possible to do that in at most $4$ "steps".

But beyond that this strikes me as a pretty random result. I'd therefore be interested in additional motivations for this result - historic or modern.

-
Like other important theorems in number theory, this one relates the additive structure of the integers with its multiplicative structure. –  lhf Aug 25 '13 at 12:29
Thanks. How exactly does it do that though? –  Timotej Aug 25 '13 at 12:46
"square" is a multiplicative concept, and "sum" is an additive concept --- that's how! –  Gerry Myerson Aug 25 '13 at 13:28

I believe that originally (e.g. when Fermat discovered that only the primes congruent to $1$ modulo $4$ could be written as sums of squares) this was seen mainly as a "curiosity".
From a more modern point of view, the problem of representing an integer as a sum of squares is part of the general theory of quadratic forms. An important step in the classification of quadratic forms over, say, a number field $K$ is the characterization of the elements of $K$ represented by a given non-degenerate quadratic form $Q(x_1,..,x_n)$, i.e. the elements $k\in K$ for which there exist (non-trivial) solutions of the equation $$Q(x_1,..,x_n)=k.$$ When $n=2$ this generalizes the problem of finding the norm subgroup in a quadratic extension of $\Bbb Q$ (which is linked to Class Fields Theory) and in general has an obvious significance in terms of arithmetic geometry of quadrics and Brauer groups.