IMO 1992 · Problem 6

For each positive integer \(n\), \(S(n)\) is defined to be the greatest integer such that, for every positive integer \(k \le S(n)\), \(n^2\) can be written as the sum of \(k\) positive squares.

(a) Prove that \(S(n) \le n^2 - 14\) for each \(n \ge 4\).

(b) Find an integer \(n\) such that \(S(n) = n^2 - 14\).

(c) Prove that there are infinitely many integers \(n\) such that \(S(n) = n^2 - 14\).

Official text of the problem. Official problem paper (PDF)

Answer

For (b), \(n=13\) works: \(S(13)=155\).

For (c), every \(n=13\cdot 2^t\), where \(t\) is a nonnegative integer, satisfies \(S(n)=n^2-14\).

Solution

All squares below are squares of positive integers.

(a) Suppose \(n^2\) were a sum of \(n^2-13\) positive squares: \[ n^2=a_1^2+\cdots+a_{n^2-13}^2. \] Subtracting the number of summands gives \[ 13=\sum_{i=1}^{n^2-13}(a_i^2-1). \] Each summand on the right belongs to \[ \{0,3,8,15,24,\ldots\}. \] Thus \(13=3u+8v\) for some nonnegative integers \(u,v\). Necessarily \(v=0\) or \(v=1\), but neither \(13\) nor \(13-8=5\) is divisible by \(3\). This is impossible.

For \(n\ge4\), the integer \(n^2-13\) is positive, so its failure implies \[ \boxed{S(n)\le n^2-14}. \]

To construct examples attaining this bound, we first prove an elementary lemma.

Lemma. If positive integers \(N,k\) satisfy \[ N-k\ge14 \qquad\text{and}\qquad 9k\ge N+35, \] then \(N\) is a sum of exactly \(k\) positive squares.

Proof. Put \(d=N-k\). Since \(3\) is relatively prime to \(8\), there is an integer \(a\in\{0,1,\ldots,7\}\) such that \(3a\equiv d\pmod8\). Write \[ d=3a+8b. \] Here \(b\) is an integer, and it is nonnegative: otherwise \[ d\le3\cdot7-8=13, \] contrary to \(d\ge14\). Moreover, \[ a+b=\frac{d+5a}{8} \le\frac{N-k+35}{8} \le k. \] Consequently, \[ N= \underbrace{2^2+\cdots+2^2}_{a\text{ terms}} +\underbrace{3^2+\cdots+3^2}_{b\text{ terms}} +\underbrace{1^2+\cdots+1^2}_{k-a-b\text{ terms}}, \] as required. A group containing zero terms is simply omitted. \(\square\)

(b) We show that \(169=13^2\) is a sum of \(k\) positive squares for every \(1\le k\le155\).

For \(23\le k\le155\), the lemma applies, because \[ 169-k\ge14, \qquad 9k\ge207\ge169+35. \]

It remains to handle \(1\le k\le22\). The cases \(k=1,2\) follow from \[ 169=13^2=12^2+5^2. \] For the other cases, use the following operation: whenever an even square occurs, replace it by four equal squares, \[ (2u)^2=u^2+u^2+u^2+u^2. \] Each operation increases the number of summands by exactly \(3\).

Starting from the identities in the table, repeatedly apply this operation to the indicated squares, stopping at any intermediate stage.

Initial representation of \(169\) Squares to split completely Numbers of summands obtained
\(12^2+4^2+3^2\) \(12^2\) into sixteen \(3^2\)'s, and \(4^2\) into sixteen \(1^2\)'s \(3,6,9,\ldots,33\)
\(10^2+8^2+2^2+1^2\) \(8^2\) into sixty-four \(1^2\)'s \(4,7,10,\ldots,67\)
\(12^2+4^2+2^2+2^2+1^2\) \(4^2\) into sixteen \(1^2\)'s \(5,8,11,\ldots,20\)

Every intermediate number listed occurs because each individual split adds exactly three summands. These three progressions cover every integer from \(3\) through \(22\).

Thus every \(k\le155\) is possible. Together with part (a), this proves \[ \boxed{S(13)=155=13^2-14}. \]

(c) We prove that whenever \(n\ge13\) satisfies \[ S(n)=n^2-14, \] the integer \(2n\) also attains the bound.

Write \(m=n^2\), so \(m\ge169\). For every \[ 1\le k\le m-14, \] there is a representation \[ m=a_1^2+\cdots+a_k^2. \] Doubling each base gives \[ 4m=(2a_1)^2+\cdots+(2a_k)^2, \] with the same number of summands.

For the remaining integers \[ m-13\le k\le4m-14, \] we have \(4m-k\ge14\), and \[ 9k\ge9m-117\ge4m+35, \] where the last inequality follows from \(5m\ge152\). The lemma, with \(N=4m\), therefore supplies a representation with exactly \(k\) positive squares.

Hence \(4m=(2n)^2\) has representations for every \(1\le k\le4m-14\). Applying part (a) yields \[ S(2n)=(2n)^2-14. \]

Starting with \(n=13\) and iterating, we obtain \[ \boxed{S(13\cdot2^t)=(13\cdot2^t)^2-14\qquad(t=0,1,2,\ldots)}. \] These integers are distinct, proving that there are infinitely many.

The solution was checked against John Scholes' IMO solution archive (Kalva).