# Prove there are infinitely many positive integers which cannot be represented as a sum of four non-zero squares.

Prove there are infinitely many positive integers which cannot be represented as a sum of four non-zero squares. Every positive integer can be written as the sum of four squares. But not all necessarily non-zero. Any hints on this?

• All squares are nonnegative. The problem comes because you rule out $0$, so $1=1^2+0^2+0^2+0^2$ is not allowed. All positive integers can be written as the sum of four squares if you allow $0$, so the problem is to show that infinitely many cannot be written without $0$. – Ross Millikan Jun 10 '20 at 4:19
• @RossMillikan yep, and i wonder how to prove there're infinitely many cannot be written as a sum of four non-zero squares? – Emma Johnson Jun 10 '20 at 4:22
• @EmmaJohnson FYI, the Uniqueness section of Wikipedia's "Lagrange's four-square theorem" gives the complete list of positive integers which cannot be represented as a sum of four non-zero squares. – John Omielan Aug 27 '20 at 20:23

Assume there are $$4$$ such non-zero squares that add up to $$2^{2n+1}$$ for any $$n \ge 1$$, i.e., you have

$$2^{2n+1} = a^2 + b^2 + c^2 + d^2 \tag{1}\label{eq1A}$$

However, note all perfect squares are congruent to $$0$$, $$1$$ or $$4$$ modulo $$8$$. Since you just asked for a hint, the rest of the answer is in the spoiler below.

Any positive integer of the form $$2^{k}$$ where $$k \ge 3$$, such as where $$k = 2n + 1$$ for $$n \ge 1$$, is congruent to $$0$$ modulo $$8$$ and can only be the sum of $$4$$ squares if they are all even (since all $$4$$ odd gives a congruence of $$4$$ modulo $$8$$, $$3$$ odd gives $$3$$ or $$7$$, $$2$$ odd gives $$2$$ or $$6$$, and just $$1$$ odd gives $$1$$ or $$5$$). Thus, you have $$a = 2a_1$$, $$b = 2b_1$$, $$c = 2c_1$$ and $$d = 2d_1$$. Substituting this into \eqref{eq1A} and dividing both sides by $$4$$ gives $$2^{2(n-1) + 1} = 2^{2n - 1} = a_1^2 + b_1^2 + c_1^2 + d_1^2 \tag{2}\label{eq2A}$$ This is an equation of the same form, so as long as the power of $$2$$ is $$\ge 3$$, you can repeat the procedure. Repeating this $$n$$ times gives $$2^{2(n-n) + 1} = 2^{1} = a_n^2 + b_n^2 + c_n^2 + d_n^2 \tag{3}\label{eq3A}$$ This is not possible since the RHS is at least $$4$$ but the LHS is just $$2$$. This means at least one (actually, $$2$$) of the squares in \eqref{eq1A} must have been $$0$$. Since \eqref{eq1A} only required that $$n \ge 1$$, and \eqref{eq3A} shows it works for $$n = 0$$ also, you have an infinite # of positive integers of the form $$2^{2n+1}$$ which cannot be represented as the sum of $$4$$ non-zero squares.

Note you can also use induction to prove $$2^{2n+1} \; \forall \; n \ge 0$$ cannot be represented by a sum of $$4$$ non-zero squares by using \eqref{eq3A} as the base case, and then using the modulo $$8$$ congruences to show you can reduce the $$n = k + 1$$ case to the $$n = k$$ case in the inductive step.

• It may be of interest that the positive integers that aren't representable as the sum of four nonzero squares are $1,3,5,9,11,17,29,41$ and the integers of the form $4^a\cdot 2$, $4^a\cdot 6$, $4^a\cdot 14$. And all positive integers except a few (twelve or fifteen, the largest of which is $33$, if I'm not misremembering) small ones are representable as the sum of five nonzero squares. – Daniel Fischer Jun 10 '20 at 14:48
• +1. You could say it differently by supposing $n$ is the least $m\ge1$ such that $2^{2m+1}$ is an exception. Then $2^{2(n-1)+1}$ is not an exception, but $2^{2(n-1)+1}=a_1^2+b_1^2+c_1^2+d_1^2$ so $n-1\le 0.$ – DanielWainfleet Jun 10 '20 at 16:02
• Couldn't this be generalized so that, if $k$ is any integer such that $2k$ is not representable as a sum of positive squares, then all numbers of the form $2^{2n+1}k$ also lack such a representation? – Cardioid_Ass_22 Jun 10 '20 at 19:00
• @Cardioid_Ass_22 Yes, you're right. As Daniel Fischer's comment states with "$4^a\cdot 2, 4^a\cdot 6, 4^a\cdot 14$", it's true using your variables for $k = 1, 3, 7$. I haven't checked, but I assume that's probably all of them. – John Omielan Jun 10 '20 at 20:34