Solution March 01, 2007

Problem

For all integers n\geq 1 we define x_{n+1}=x_1^2+x_2^2+\cdots +x_n^2, where x1 is a positive integer. Find the least x1 such that 2006 divides x2006.

Solution

Clearly, x_{n+1} = x_n + x_n^2 = x_n(x_n+1)\,.

If p\, divides x_n\, it will also divide x_m\, for all m\geq n\,.

Note that 2006 = 2\cdot 17\cdot 59, so we can consider the sequence modulo each of these three primes separately.

Assume that 2006 | x_{2006}\,.

Let p\in\{2,17,59\}\,, and let n\, be the smallest index such that p | x_n\,. If n=1\, then x_1\equiv 0\pmod p. Otherwise x_n = x_{n-1}(x_{n-1}+1)\equiv 0\pmod p, i.e. x_{n-1} \equiv 0\pmod p or x_{n-1} \equiv -1 \pmod p. The first possibility is ruled out by our choice of n\,. If n=2\, this implies x_1\equiv 1\pmod p.

Now assume that n>2\,. Then,

x_{n-1} = x_{n-2}(x_{n-2}+1)\equiv -1 \pmod p\qquad\qquad(1)
4x_{n-2}(x_{n-2}+1)-1\equiv -5 \pmod p
(2x_{n-2}+1)^2\equiv -5 \pmod p\qquad\qquad(2)

Now consider each p\, in turn.

Note: The last two cases show that -5\, is not a quadratic residue (http://en.wikipedia.org/wiki/Quadratic_residue) modulo 17\, or 59\,.

In summary, we have that x_1\equiv 0\pmod p or x_1\equiv -1\pmod p for p\in\{2,17,59\}. For p=2\, this is no restriction. So we have four cases, which we can solve using the Chinese Remainder Theorem (http://en.wikipedia.org/wiki/Chinese_remainder_theorem)

The smallest positive solution is x_1=118\,. \square