๐Ÿงฎ Brain Teaser

Zeros Hidden Before the Beginning

Define a sequence of integers by

xk=kforย k=1,2,โ€ฆ,2006,x_k = k \quad \text{for } k = 1, 2, \dots, 2006,

and, for kโ‰ฅ2006k \ge 2006,

xk+1=xk+xkโˆ’2005.x_{k+1} = x_k + x_{k-2005}.

So the sequence begins

1,2,3,โ€ฆ,2005,2006,2007,2009,2012,2016,โ€ฆ1, 2, 3, \dots, 2005, 2006, 2007, 2009, 2012, 2016, \dots

Prove that the sequence contains 2005 consecutive terms, each divisible by 20062006.

(Hint-free version: try it first. If stuck, ask yourself where the sequence came from, not where it is going.)

recurrenceperiodicity mod Npigeonholeinvertible dynamicsrunning backwards

Answer: Zeros Hidden Before the Beginning

Key Idea / Intuition

Modulo NN, a recursion that depends on finitely many previous terms is eventually periodic, because there are only finitely many possible "windows" of consecutive residues. If the recursion can also be run backwards with integer coefficients, the step map is a bijection on a finite set. Then the sequence is purely periodic mod NN, so its past repeats in its future. Running this recursion backwards from the start produces exactly 20052005 zeros. Periodicity then carries that block of zeros into the positive indices.

Instead of searching forward for zeros, look backward: the forward-looking sequence hides the zeros "before time 11."


Formal Proof / Solution

Step 1: Extend the sequence to all integers. The recursion xk+1=xk+xkโˆ’2005x_{k+1} = x_k + x_{k-2005} can be rewritten as

xj=xj+2006โˆ’xj+2005.x_{j} = x_{j+2006} - x_{j+2005}.

This defines xjx_j uniquely for all jโ‰ค0j \le 0. The result is a doubly infinite integer sequence (xk)kโˆˆZ(x_k)_{k\in\mathbb Z} satisfying xk+1=xk+xkโˆ’2005x_{k+1} = x_k + x_{k-2005} for every kโˆˆZk \in \mathbb Z.

Step 2: Compute backwards.

  • For j=0,โˆ’1,โ€ฆ,โˆ’2004j = 0, -1, \dots, -2004, the indices j+2006j+2006 and j+2005j+2005 range over consecutive values in {1,โ€ฆ,2006}\{1,\dots,2006\}, where xm=mx_m = m. So xj=(j+2006)โˆ’(j+2005)=1(โˆ’2004โ‰คjโ‰ค0).x_j = (j+2006) - (j+2005) = 1 \qquad (-2004 \le j \le 0).
  • For j=โˆ’2005,โ€ฆ,โˆ’4009j = -2005, \dots, -4009, the indices j+2006j+2006 and j+2005j+2005 are consecutive values in {โˆ’2003,โ€ฆ,1}\{-2003, \dots, 1\}. Every such value of xx equals 11: we have x1=1x_1 = 1, and xm=1x_m = 1 for โˆ’2004โ‰คmโ‰ค0-2004 \le m \le 0. Hence xj=1โˆ’1=0(โˆ’4009โ‰คjโ‰คโˆ’2005).x_j = 1 - 1 = 0 \qquad (-4009 \le j \le -2005).

That gives 4009โˆ’2005+1=20054009 - 2005 + 1 = 2005 consecutive zeros: xโˆ’4009=โ‹ฏ=xโˆ’2005=0x_{-4009} = \cdots = x_{-2005} = 0.

Step 3: Pure periodicity modulo N=2006N = 2006. Consider the "window" vectors

Sk=(xkโˆ’2005,xkโˆ’2004,โ€ฆ,xk)โ€Šmodโ€ŠNโˆˆ(Z/N)2006.S_k = (x_{k-2005}, x_{k-2004}, \dots, x_k) \bmod N \in (\mathbb Z/N)^{2006}.

The recursion gives a map T:Skโ†ฆSk+1T: S_k \mapsto S_{k+1}. It shifts the window left and appends xk+xkโˆ’2005x_k + x_{k-2005}.

TT is invertible: from Sk+1S_{k+1} we recover the dropped entry as xkโˆ’2005=xk+1โˆ’xkx_{k-2005} = x_{k+1} - x_k.

So TT is a permutation of the finite set (Z/N)2006(\mathbb Z/N)^{2006}. Some power is the identity: Tp=idT^p = \mathrm{id} for some pโ‰ฅ1p \ge 1, for instance the order of TT in the symmetric group. Therefore

xk+pโ‰กxk(modN)forย allย kโˆˆZ.x_{k+p} \equiv x_k \pmod{N} \qquad \text{for all } k \in \mathbb Z.

Step 4: Transport the zeros forward. Choose mm with mp>4009mp > 4009. Then for โˆ’4009โ‰คjโ‰คโˆ’2005-4009 \le j \le -2005,

xj+mpโ‰กxj=0(mod2006).x_{j+mp} \equiv x_j = 0 \pmod{2006}.

The indices j+mpj + mp are positive. They are 20052005 consecutive terms of the original sequence, each divisible by 20062006. โ– \blacksquare


Remarks.

  • The same argument shows that this sequence has arbitrarily long runs of terms divisible by any NN (here, up to 20052005 consecutive terms). Nothing about 20062006 was used except in setting up the recursion.
  • The general principle is reusable: an invertible recursion over a finite ring is purely periodic. It is the same reason the Fibonacci sequence mod NN returns to 0,10, 1, so every NN divides some Fibonacci number.

Source: Putnam 2006 A3; solutions by Kiran Kedlaya and Lenny Ng (materials/putnam/2006s.pdf)

Type: PutnamSource: Putnam 2006 A3; solutions by Kiran Kedlaya and Lenny Ng (materials/putnam/2006s.pdf)Edit on GitHub โ†—