# Is it known whether any positive integer can be written as the sum of $n$ different squares?

Is it known whether any sufficiently large positive integer can be written as the sum of four different squares? I know that every positive integer can be written as the sum of four not necessarily different squares.

Furthermore, OEIS has a sequence of numbers that can be written as the sum of any number of different squares: A003995. The largest integer not in the sequence is 128.

Is there anything known about this? If so, can someone give a reference to the proof or give a sketch how to proof it?

Update (Thanks, Mark Bennet!) :

From Jacobi's four-square theorem it follows that there are only 24 ways to write a power of two as the sum of four squares. However, if all those squares are different, there are at least 16*24>24 ways, since there are 16 ways to choose sign and 24 ways to choose order. Therefore a power of two cannot be written as the sum of four different squares. Is this correct?

If so, I want to restate my question. Is it, for any integer $n$, known whether any sufficiently large positive integer can be written as the sum of $n$ different squares?

• I'd predominately check that the distance between any 2 squares can be bridged without exception by the remainder squares That is if $(n+1)^2=n^2+2n+1$ then can $2n+1$ in turn be written as squares that are different? And so onward downward May 16, 2015 at 14:26
• See en.wikipedia.org/wiki/Jacobi's_four-square_theorem where the number of representations as a sum of four squares is explicitly computed May 16, 2015 at 14:29
• @MarkBennet Thank you. Is it correct what I wrote? May 16, 2015 at 14:36
• The function $r_4(n)$ that gives the number of representations of an integer as a sum of four squares should grow faster than the function that gives the number of representations as a sum of four squares, in which two or more of these squares are equal. May 16, 2015 at 14:36
• This post on MathOverflow might interest you; it's pretty close, though not identical, to the question you're asking. May 16, 2015 at 14:39

From Jacobi's four-square theorem it follows that there are only 24 ways to write a power of two as the sum of four squares. However, if all those squares are different, there are at least $16\cdot24>24$ ways, since there are 16 ways to choose sign and 24 ways to choose order. Therefore a power of two cannot be written as the sum of four different squares.