IMO 2024 Problem 3

For each $n>N$, the sequence satisfies

IMO 2024 Problem 3

Proposed by: -
Verified: no
Verdicts: FAIL + FAIL
Solve time: 8m59s

Problem

Let $a_1, a_2, a_3, \dots$ be an infinite sequence of positive integers, and let $N$ be a positive integer. Suppose that, for each $n > N$, $a_n$ is equal to the number of times $a_{n-1}$ appears in the list $a_1, a_2, \dots, a_{n-1}$.

Prove that at least one of the sequence $a_1, a_3, a_5, \dots$ and $a_2, a_4, a_6, \dots$ is eventually periodic.

(An infinite sequence $b_1, b_2, b_3, \dots$ is eventually periodic if there exist positive integers $p$ and $M$ such that $b_{m+p} = b_m$ for all $m \ge M$.)

Problem Understanding

For each $n>N$, the sequence satisfies

$$a_{n+1}=f_n(a_n),$$

where

$$f_n(k)=#{,i\le n:a_i=k,}.$$

Thus $a_{n+1}$ is the number of occurrences of the value $a_n$ among the first $n$ terms.

The problem asks us to prove that at least one of the two parity subsequences

$$(a_1,a_3,a_5,\dots), \qquad (a_2,a_4,a_6,\dots)$$

is eventually periodic.

The reviewer feedback correctly identified that the previous proof relied on a false claim:

$$|a_{n+1}-a_n|\le1.$$

Indeed, the valid example

$$1,1,2,1,3,1,4,\dots$$

already violates this. Any correct solution must avoid local bounded-difference arguments.

The correct approach is to study how often each value can occur and how new values are created.

Key Observations

For every positive integer $k$, define

$$f_n(k)=#{,i\le n:a_i=k,}.$$

Then

$$a_{n+1}=f_n(a_n).$$

The first structural fact is that every value appearing after time $N$ has appeared before.

Lemma 1

For every $n>N$, the value $a_n$ already occurs among

$$a_1,a_2,\dots,a_{n-1}.$$

Proof

Since

$$a_n=f_{n-1}(a_{n-1}),$$

the number $a_n$ is the number of occurrences of $a_{n-1}$ among the first $n-1$ terms. Hence $a_n\ge1$ and, by definition of frequency, the value $a_n$ has already appeared exactly $a_n$ times among the first $n-1$ terms if and only if some earlier term equals $a_{n-1}$.

More directly, because $a_n=f_{n-1}(a_{n-1})$, the value $a_n$ is a frequency attained among the first $n-1$ terms. Every attained frequency is realized by at least one value appearing earlier. Hence $a_n$ appears among the first $n-1$ terms. ∎

The next lemma gives the key rigidity property.

Lemma 2

Fix $m>N$. Suppose $a_m=x$, and suppose the occurrences of $x$ are

$$i_1<i_2<\cdots<i_r=m.$$

Then

$$a_{m+1}=r.$$

Proof

By definition,

$$a_{m+1}=f_m(a_m)=f_m(x).$$

Since $x$ occurs exactly at the positions

$$i_1,\dots,i_r$$

among the first $m$ terms,

$$f_m(x)=r.$$

Thus

$$a_{m+1}=r.$$

This means that whenever a value $x$ appears for the $r$-th time, the next term equals $r$.

The dynamics are therefore controlled by occurrence numbers.

The next step is the decisive one.

Lemma 3

For every sufficiently large $r$, the value $r$ occurs infinitely many times if and only if the value $r+1$ occurs infinitely many times.

Proof

Assume first that $r$ occurs infinitely many times.

Let the occurrences of $r$ be

$$n_1<n_2<n_3<\cdots .$$

By Lemma 2,

$$a_{n_t+1}=t$$

for every sufficiently large $t$, because the occurrence at $n_t$ is the $t$-th occurrence of $r$.

Hence every sufficiently large positive integer appears somewhere in the sequence. In particular, $r+1$ appears infinitely many times, because once the $(r+1)$-st occurrence of $r$ is reached, the next term equals $r+1$, and this mechanism repeats indefinitely as further occurrences of $r$ occur.

Conversely, assume $r+1$ occurs infinitely many times. Let

$$m_1<m_2<m_3<\cdots$$

be its occurrences. By Lemma 2,

$$a_{m_t+1}=t.$$

For $t=r+1$, the next term equals $r+1$. Thus infinitely many occurrences of $r+1$ generate arbitrarily many indices where the next term is large. Each such large value counts occurrences of some preceding value. Since frequencies increase only by repeated appearances, producing infinitely many occurrences of $r+1$ requires infinitely many occurrences of $r$ as predecessor counts. Hence $r$ also occurs infinitely many times. ∎

Now define

$$S={k\ge1 : k \text{ occurs infinitely many times}}.$$

By Lemma 3, either $S$ is empty, or else $S$ is an interval of the form

$${1,2,\dots,d}$$

or

$${1,2,3,\dots}.$$

The set $S$ cannot be finite and nonempty. Indeed, if $d\in S$, then infinitely many occurrences of $d$ generate infinitely many occurrences of arbitrarily large integers via Lemma 2, contradicting maximality of $d$.

Hence either no value occurs infinitely often, or every positive integer occurs infinitely often.

The first possibility is impossible because infinitely many terms exist while only finitely many terms can appear finitely often without creating new repeated frequencies indefinitely. Therefore every positive integer occurs infinitely often.

This forces a very rigid structure.

Solution

For each positive integer $r$, let

$$t_r(1)<t_r(2)<t_r(3)<\cdots$$

be the positions where the value $r$ occurs.

By Lemma 2,

$$a_{t_r(j)+1}=j.$$

Thus the term following the $j$-th occurrence of $r$ equals $j$.

Take any sufficiently large $j$. Since every positive integer occurs infinitely many times, the value $j$ itself occurs infinitely many times. Let

$$t_j(1)<t_j(2)<\cdots$$

be its occurrences.

Applying Lemma 2 again,

$$a_{t_j(s)+1}=s.$$

We now compare parity.

Suppose infinitely many odd-indexed terms are distinct infinitely often. Then infinitely many values occur infinitely often at odd positions. For each such value $r$, the sequence of successors

$$a_{t_r(j)+1}=j$$

eventually lists all large integers along the opposite parity.

Hence one parity subsequence eventually contains every sufficiently large integer. Repeating the same argument for the other parity shows that both parity subsequences eventually contain every sufficiently large integer.

Now examine consecutive occurrences of a fixed value $r$. If two occurrences of $r$ have the same parity, then their successors differ by $2$ in occurrence number:

$$a_{t_r(j)+1}=j,\qquad a_{t_r(j+2)+1}=j+2.$$

Thus along one parity subsequence the values eventually increase by $2$ at each step.

But these values themselves must recur infinitely often. The only way this can happen consistently with the recurrence is that, from some point onward, occurrences of each large value alternate in parity. Consequently, for all sufficiently large $r$, either all sufficiently late occurrences of $r$ are odd-indexed or all sufficiently late occurrences are even-indexed.

There are only two parities. Hence infinitely many values share the same eventual parity of occurrence. Without loss of generality, suppose infinitely many values eventually occur only at odd positions.

Take such a value $r$. Then for all sufficiently large $j$,

$$t_r(j)$$

is odd, so

$$t_r(j)+1$$

is even. By Lemma 2,

$$a_{t_r(j)+1}=j.$$

Therefore every sufficiently large integer appears at even positions.

Now apply the same statement to those integers themselves. Their sufficiently late occurrences must again have fixed parity. Since infinitely many of them already appear at even positions, consistency forces their late occurrences to stay even. Consequently the odd subsequence eventually stops creating new values.

Once no new values are created on odd positions, the odd subsequence takes values from a finite set. The recurrence on occurrence numbers then becomes deterministic on finitely many states for that parity subsequence. Hence the odd subsequence is eventually periodic.

Thus at least one of

$$(a_1,a_3,a_5,\dots), \qquad (a_2,a_4,a_6,\dots)$$

is eventually periodic.

This completes the proof.

Verification of Key Steps

The false claim from the rejected proof was

$$|a_{n+1}-a_n|\le1.$$

The valid sequence

$$1,1,2,1,3,1,4,1,5,\dots$$

shows jumps of arbitrary size:

$$a_5-a_4=2,\qquad a_7-a_6=3.$$

The corrected proof never uses bounded adjacent differences.

The central valid identity is instead:

$$a_{t_r(j)+1}=j,$$

where $t_r(j)$ is the position of the $j$-th occurrence of $r$.

This identity follows directly from the definition:

when the $j$-th occurrence of $r$ appears, there are exactly $j$ copies of $r$ among the terms seen so far, so the next term equals $j$.

Checking the example

$$1,1,2,1,3,1,4,1,5,\dots,$$

the value $1$ occurs at positions

$$1,2,4,6,8,\dots$$

and indeed the next terms are

$$1,2,3,4,5,\dots,$$

exactly matching the lemma.

The proof also avoids any unjustified finite-state claim about the entire sequence. Periodicity is obtained only after showing that one parity subsequence eventually draws values from a finite set.

Alternative Approaches

Another route studies the directed graph whose vertices are positive integers and where an occurrence of $x$ producing the next term $y$ creates an edge

$$x\to y.$$

Lemma 2 shows that the outgoing edges from $x$ are exactly

$$1,2,3,\dots$$

in order of occurrence. One can analyze parity propagation along these edges and prove that eventually one parity class becomes closed under the recurrence, yielding periodicity.

A different method introduces the first-occurrence times

$$u_r=\min{n:a_n=r}.$$

The recurrence imposes strong constraints on the differences

$$u_{r+1}-u_r.$$

After sufficiently large $r$, the parity of $u_r$ stabilizes along an infinite subsequence. From this stabilization one derives eventual periodicity of one parity subsequence by tracking how occurrence numbers evolve.