MathLabs

Problem 3

Let a1,a2,a3,…a_1,a_2,a_3,\ldots be an infinite sequence of positive integers, and let NN be a positive integer. Suppose that, for each n>Nn>N, the number ana_n is equal to the number of times an−1a_{n-1} appears in the list (a1,a2,…,an−1)(a_1,a_2,\ldots,a_{n-1}). Prove that at least one of the sequences a1,a3,a5,…a_1,a_3,a_5,\ldots and a2,a4,a6,…a_2,a_4,a_6,\ldots is eventually periodic.
Step 1 of 6: The tower picture
In plain words

Imagine placing a numbered block for every term of the sequence into the tower labeled by its value; then each new term after index N is exactly the current height of the tower that the previous term points to.

M=max⁡(a1,…,aN)M=\max(a_1,\ldots,a_N)
Detailed analysis

Set M=max⁡(a1,…,aN)M=\max(a_1,\ldots,a_N) and visualize a row of towers labeled 1,2,3,…1,2,3,\ldots; for i=1,2,…i=1,2,\ldots, term aia_i adds a block to tower aia_i. The first NN blocks are called red; for i>Ni>N, block aia_i is placed on tower aia_i, whose new height after this placement is by definition aia_i itself, i.e. block aia_i lands exactly at height aia_i in its tower — reflecting that aia_i counts how many times ai−1a_{i-1} has appeared so far.