TITLE: Numbers which are not the sum of distinct squares
QUESTION [6 upvotes]: We are defining  square factorization as representation a positive natural number as sum of squares of different positive, integer numbers. For example $5 = 1^2 +2^2$ and $5$ has no more representation. But one number can possess more representations, eg. $30$.
$$30 = 1^2 + 2^2 + 5^2 = 1^2 +2^2 + 3^2 + 4^2$$
Sometimes $n$ has no representation, eg. $8$. If square factorization for $n$ is impossible, we call $n$ indecomposable, so $8$ is indecomposable. Because it is a significant part of other proof I began to wonder, how can we know there is finite number of indecomposable numbers. Of course, it is well know fact, but I have still problem with proving that.
How to show that any number greater than $128$ can be written as sum of distinct squares — for all $n > 128$ square factorization exist?

REPLY [3 votes]: I actually did this for fun when I was 17 (and it was mostly fun, though a bit of a grind). The way I did it was to realise that, for numbers 0 mod 4, I only needed to test up to 512, because anything after that could be written as 4 times the solution for the quarter of that number (for example, if 129 = 100 + 25 + 4, then 516 = 400 + 100 + 16). After that, numbers 1 mod 4 need to be tested up to 517 (take any solution that can be quadrupled and add 1), numbers 2 mod 4 need to be tested up to 526 (add 9 and 1), and numbers 3 mod 4 need to be tested up to 551 (add 25, 9 and 1). The grindy part was testing all those numbers.