[Math] Integers which are the sum of non-zero squares

elementary-number-theorynumber theory

Lagrange's four-square theorem states that every natural number can be written as the sum of four squares, allowing for zeros in the sum (e.g. $6=2^2+1^2+1^2+0^2$). Is there a similar result in which zeros are not allowed in the sum? For example, does there exist $n\in\mathbb{N}$ such that every natural number greater than $n$ can be written as the sum of five non-zero squares, or six non-zero squares, for example?

Best Answer

This question is answered in "Introduction to Number Theory" by Niven, Zuckerman& Montmogery (pp.318-319 of the fifth edition). I summarize their proof below.

Every integer $\geq 34$ is a sum of five positive squares (while $33$ is not). The number five is optimal, because the only representation of $2^{2r+1}$ as a sum of four squares is $0^2+0^2+(2^r)^2+(2^r)^2$ (easy exercice by induction on $r$).

One can check by hand by noting all the numbers between $34$ and $169$ are sums of five positive squares. Now, let $n\geq 169$ and let us show that $n$ is a sum of five positive squares.

We know that $n-169$ is a sum of four not necessarily positive squares, $n-169=x_1^2+x_2^2+x_3^2+x_4^2$ and we can assume $x_1 \leq x_2 \leq x_3 \leq x_4$.

If $x_1>0$, writing $n=13^2+x_1^2+x_2^2+x_3^2+x_4^2$ we are done. So assume $x_1=0$.

If $x_2>0$, writing $n=5^2+12^2+x_2^2+x_3^2+x_4^2$ we are done. So assume $x_2=0$.

If $x_3>0$, writing $n=3^2+4^2+12^2+x_3^2+x_4^2$ we are done. So assume $x_3=0$.

If $x_4>0$, writing $n=2^2+4^2+7^2+12^2+x_4^2$ we are done. So assume $x_4=0$.

So now all the $x_i$ are zero, and $n=169=5^2+6^2+6^2+6^2+6^2$. This concludes the proof.

Related Question