# How to express a number as a sum of $k$ squares?

My question is the following: Show that for each integer $$k \ge 5$$, there is an integer $$N(k)$$ such that every integer $$n \ge N(k)$$ can be written as a sum of $$k$$ nonzero squares.

What is the process to prove this? I'm able to do this for the first few values of $$k$$, but I'm not able to find a version of induction that works for this.

You state that you've already proved this for "the first few values of $$k$$", so only the inductive step remains.

1 is a perfect square. Hence, if you can write $$n$$ as a sum of $$k$$ nonzero squares, then you can write $$n+1$$ as a sum of $$k+1$$ nonzero squares, by letting one of those squares equal 1 and thus reducing to a previously solved problem.

It then follows that $$N(k+1) \le N(k)+1$$.

• You have to prove the base case $k=5$ to make this induction work. – TonyK Nov 8 '18 at 2:51
• @TonyK Indeed you do, but OP says "I'm able to do this for the first few values of k" so presumably that's taken care of. I will edit my post to clarify this. – Geoffrey Brent Nov 8 '18 at 2:52
• Unlikely the OP has a proof for 5 nonzero squares. See my brief answer – Will Jagy Nov 8 '18 at 3:33

In the last few pages of The Sensual Quadratic Form by J. H. Conway, it is proved that the numbers that are not the sum of four nonzero integer squares are $$1,3,5,9,11,17,29,41, \; 2 \cdot 4^m \; , \; 6 \cdot 4^m \; , \; 14 \cdot 4^m$$

ADDED: with four nonzero squares we get all odd numbers 43 or larger. Add a single 1 and we get all even numbers 44 or larger. Alternatively, add a single 4, get all odd numbers 47 or above with five nonzero squares. Together, we can write all numbers 47 or larger with five nonzero squares.