Maths Olympiad Prep

Library / International Mathematical Olympiad /101 of 110

International Mathematical Olympiad

Combinatorics Difficulty 9.0 IMO level Prove it IMO

For a positive integer nn, an nn-sequence is a sequence (a0,…,an)(a_{0}, \ldots, a_{n}) of non-negative integers satisfying the following condition: if ii and jj are non-negative integers with i+j⩽ni+j \leqslant n, then ai+aj⩽na_{i}+a_{j} \leqslant n and aai+aj=ai+ja_{a_{i}+a_{j}}=a_{i+j}.
Let f(n)f(n) be the number of nn-sequences. Prove that there exist positive real numbers c1,c2c_{1}, c_{2} and λ\lambda such that
c1λn<f(n)<c2λn c_{1} \lambda^{n}<f(n)<c_{2} \lambda^{n}
for all positive integers nn.

Solution

In order to solve this, we will give a complete classification of nn-sequences.
Let k=⌊n/2⌋k=\lfloor n / 2\rfloor. We will say that an nn-sequence is large if ai>ka_{i}>k for some ii, and small if no such ii exists. For now we will assume that (ai)(a_{i}) is not the identity sequence (in other words, that ai≠ia_{i} \neq i for some ii).

Lemma 1. If ar=asa_{r}=a_{s} and r,s<nr, s<n, then ar+1=as+1a_{r+1}=a_{s+1}.
Proof. We have ar+1=aar+a1=aas+a1=as+1a_{r+1}=a_{a_{r}+a_{1}}=a_{a_{s}+a_{1}}=a_{s+1}.

Lemma 2. If i⩽ki \leqslant k, then ai⩽ka_{i} \leqslant k.
Proof. We have i+i⩽ni+i \leqslant n, so ai+ai⩽na_{i}+a_{i} \leqslant n whence ai⩽ka_{i} \leqslant k.

Lemma 3. There exist r,sr, s such that ar=asa_{r}=a_{s} and r≠sr \neq s.
Proof. If a0≠0a_{0} \neq 0 then a2a0=a0a_{2 a_{0}}=a_{0}. Otherwise, aai=aia_{a_{i}}=a_{i} for all ii, so take ii such that ai≠ia_{i} \neq i (which we can do by our earlier assumption).

Lemma 4. Let rr be the smallest index such that as=ara_{s}=a_{r} for some s>rs>r, and let dd be the minimum positive integer such that ar+d=ara_{r+d}=a_{r}. Then
1. The subsequence (ar,ar+1,…,an)(a_{r}, a_{r+1}, \ldots, a_{n}) is periodic with minimal period dd. That is, for u<vu<v, we have au=ava_{u}=a_{v} if and only if u,v⩾ru, v \geqslant r and d∣v−ud \mid v-u.
2. ai=ia_{i}=i for i<ri<r and ai⩾ra_{i} \geqslant r for i⩾ri \geqslant r.
In this case we say (ai)(a_{i}) has period dd and offset rr.
Proof. We prove each in turn:
1. The "if" implication is clear from Lemma 1. For the reverse direction, suppose au=ava_{u}=a_{v}. Then there are integers r⩽u0,v0<r+dr \leqslant u_{0}, v_{0}<r+d such that d∣u−u0,v−v0d \mid u-u_{0}, v-v_{0}, so au0=au=av=av0a_{u_{0}}=a_{u}=a_{v}= a_{v_{0}}. If u0<v0u_{0}<v_{0} then ar+d+u0−v0=ar+d=ara_{r+d+u_{0}-v_{0}}=a_{r+d}=a_{r}, contradicting the minimality of dd. There is a similar contradiction when u0>v0u_{0}>v_{0}. Thus u0=v0u_{0}=v_{0}, so d∣u−vd \mid u-v.
2. If r=0r=0 there is nothing to prove. Otherwise a0=a2a0a_{0}=a_{2 a_{0}} so 2a0=02 a_{0}=0. Then we have aai=aia_{a_{i}}=a_{i} for all ii, so ai=ia_{i}=i for i<ri<r.

Lemma 5. Either
1. d∣ai−id \mid a_{i}-i for all ii, or
2. r=0r=0 and d∣ai−i−d/2d \mid a_{i}-i-d / 2 for all ii.
Proof. Note that Lemma 4 tells us that if au=ava_{u}=a_{v} then d∣u−vd \mid u-v. Since aai+a0=aia_{a_{i}+a_{0}}=a_{i} for all ii, we have d∣ai−i+a0d \mid a_{i}-i+a_{0}. For i=0i=0, this means that d∣2a0d \mid 2 a_{0}. If d∣a0d \mid a_{0} then that means that d∣ai−id \mid a_{i}-i for all ii. Otherwise, if d∤a0d \nmid a_{0}, then d∣a0−d/2d \mid a_{0}-d / 2 and thus d∣ai−i−d/2d \mid a_{i}-i-d / 2 for all ii. In addition, part 2 of Lemma 4 says that we must have r=0r=0 in this case.

Lemma 6. If dd is even and d∣a0−d/2d \mid a_{0}-d / 2, then (ai)(a_{i}) is small. (Note that we must have r=0r=0 in this case.)
Proof. Note that if d⩽k+1d \leqslant k+1, then by Lemma 2, (a0,…,ad−1)(a_{0}, \ldots, a_{d-1}) is a period for the sequence consisting of elements at most kk, so (ai)(a_{i}) must be small. Now suppose d>k+1d>k+1. We show that ai⩽ka_{i} \leqslant k for all ii by induction. Note that Lemma 2 already establishes this for i⩽ki \leqslant k. We must have d∣ad/2d \mid a_{d / 2} and ad/2⩽k<da_{d / 2} \leqslant k<d so ad/2=0a_{d / 2}=0. Thus, for i>ki>k, if aj⩽ka_{j} \leqslant k for j<ij<i, then ai−d/2⩽ka_{i-d / 2} \leqslant k, so ai=a(i−d/2)+d/2=aai−d/2⩽ka_{i}=a_{(i-d / 2)+d / 2}=a_{a_{i-d / 2}} \leqslant k.

Lemma 7. If (ai)(a_{i}) is small, then r+d⩽k+1r+d \leqslant k+1.
Proof. Since (ai)(a_{i}) is small, there exists u,v⩽k+1u, v \leqslant k+1 such that u<vu<v and au=ava_{u}=a_{v}. Thus u⩽ru \leqslant r and d∣v−ud \mid v-u, so r+d⩽v⩽k+1r+d \leqslant v \leqslant k+1.

Lemma 8. If (ai)(a_{i}) is large, then r+d>k+1r+d>k+1 and ai=ia_{i}=i for all 0⩽i<r+d0 \leqslant i<r+d.
Proof. Since (ai)(a_{i}) is large and has period dd and offset rr, the period (ar,…,ar+d−1)(a_{r}, \ldots, a_{r+d-1}) must have an element that is larger than kk, so by Lemma 2 we must have r+d−1>kr+d-1>k.
We already have ai=ia_{i}=i for i<ri<r. Now we show that ai=ia_{i}=i for r⩽i⩽kr \leqslant i \leqslant k. By Lemma 6 we have d∣ai−id \mid a_{i}-i but r⩽i⩽kr \leqslant i \leqslant k. Since k−r+1>dk-r+1>d, this means that ai=ia_{i}=i for i⩽ki \leqslant k.
Finally, one can show inductively that ai=ia_{i}=i for k<i<r+dk<i<r+d. Indeed, if aj=ja_{j}=j for all j<ij<i, then ai⩾ia_{i} \geqslant i (otherwise ai=aja_{i}=a_{j} for some j<ij<i, but then r⩽jr \leqslant j and i<r+di<r+d means that d∤j−id \nmid j-i.) However, ai+(n−i)=ai+an−i⩽na_{i}+(n-i)=a_{i}+a_{n-i} \leqslant n, so ai=ia_{i}=i.

Thus large sequences are determined by rr and dd. It is not hard to check that all sequences of the form ai=ia_{i}=i for i<r+di<r+d and with period dd and offset rr are nn-sequences. There are (n−k−1)(n+k+2)/2(n-k-1)(n+k+2) / 2 possible choices of (r,d)(r, d) where 0⩽r<n,d⩾10 \leqslant r<n, d \geqslant 1, and k+1<r+d⩽nk+1<r+d \leqslant n.

For small sequences, for a given period dd and offset rr, we need to choose the period (ar,…,ar+d−1)(a_{r}, \ldots, a_{r+d-1}) satisfying r⩽aj⩽kr \leqslant a_{j} \leqslant k and d∣aj−jd \mid a_{j}-j for r⩽j<r+dr \leqslant j<r+d. There are g(k+1−r,d)g(k+1-r, d) such choices, where we define g(x,d)g(x, d) to be (p+1)qpd−q(p+1)^{q} p^{d-q} with p=⌊x/d⌋p=\lfloor x / d\rfloor and q=x−dpq=x-d p.

Furthermore, if dd is even then there are g(k+1,d)g(k+1, d) choices for the period (a0,…,ad−1)(a_{0}, \ldots, a_{d-1}) satisfying d∣aj−j−d/2d \mid a_{j}-j-d / 2 for j<dj<d. Again it is not hard to check that, once these choices are made, then the resulting sequence is an nn-sequence.

Thus the total number of nn-sequences is
f(n)=1+(n−k−1)(n+k+2)2+∑d′=1⌊(k+1)/2⌋g(k+1,2d′)+∑r=0k∑d=1k+1−rg(k+1−r,d) \begin{equation*} f(n)=1+\frac{(n-k-1)(n+k+2)}{2}+\sum_{d'=1}^{\lfloor(k+1) / 2\rfloor} g\left(k+1,2 d'\right)+\sum_{r=0}^{k} \sum_{d=1}^{k+1-r} g(k+1-r, d) \tag{1} \end{equation*}

Now, to show that f(n)>c1λnf(n)>c_{1} \lambda^{n} for some c1c_{1}, we note that
f(n)>g(k+1,⌊k+13⌋)⩾3⌊(k+1)/3⌋>3n/6−1. f(n)>g\left(k+1,\left\lfloor\frac{k+1}{3}\right\rfloor\right) \geqslant 3^{\lfloor(k+1) / 3\rfloor}>3^{n / 6}-1 .

To show that f(n)<c2λnf(n)<c_{2} \lambda^{n} for some c2c_{2}, it actually suffices to show that there is a positive real number c3c_{3} such that for all positive integers xx,
∑d=1xg(x,d)⩽c33x/3 \sum_{d=1}^{x} g(x, d) \leqslant c_{3} 3^{x / 3}
In fact, the following lemma suffices, as it bounds the left hand side of the above inequality by a pair of geometric series with initial term 3x/33^{x / 3} :

Lemma. For positive d,xd, x, we have:
g(x,d)⩽{3x/3(6481)x/3−d, if d⩽x/3;3x/3(89)d−x/3, if d⩾x/3. g(x, d) \leqslant \begin{cases}3^{x / 3}\left(\frac{64}{81}\right)^{x / 3-d}, & \text{ if } d \leqslant x / 3 ; \\ 3^{x / 3}\left(\frac{8}{9}\right)^{d-x / 3}, & \text{ if } d \geqslant x / 3 .\end{cases}

Proof. There are a few key observations needed, all of which are immediate from the definition:
- (x,d)(x, d) is the maximum product of a sequence of dd integers that sums to xx.
- For any positive integer kk, we have g(kx,kd)=g(x,d)kg(k x, k d)=g(x, d)^{k}.
- If 2d⩽x⩽3d2 d \leqslant x \leqslant 3 d, then g(x,d)=23d−x3x−2dg(x, d)=2^{3 d-x} 3^{x-2 d}. Likewise, if 3d⩽x⩽4d3 d \leqslant x \leqslant 4 d then g(x,d)=34d−x4x−3dg(x, d)= 3^{4 d-x} 4^{x-3 d}.

With these observations, if d⩽x/3d \leqslant x / 3, then
34(x−3d)g(3x,3d)⩽g(3x+12(x−3d),3d+4(x−3d))=g(15x−36d,4x−9d) 3^{4(x-3 d)} g(3 x, 3 d) \leqslant g(3 x+12(x-3 d), 3 d+4(x-3 d))=g(15 x-36 d, 4 x-9 d)
To calculate g(15x−36d,4x−9d)g(15 x-36 d, 4 x-9 d), note that
3(4x−9d)=12x−27d⩽15x−36d,4(4x−9d)=16x−36d⩾15x−36d, \begin{aligned} & 3(4 x-9 d)=12 x-27 d \leqslant 15 x-36 d, \\ & 4(4 x-9 d)=16 x-36 d \geqslant 15 x-36 d, \end{aligned}
so
g(15x−36d,4x−9d)=34(4x−9d)−(15x−36d)4(15x−36d)−3(4x−9d)=3x43(x−3d) g(15 x-36 d, 4 x-9 d)=3^{4(4 x-9 d)-(15 x-36 d)} 4^{(15 x-36 d)-3(4 x-9 d)}=3^{x} 4^{3(x-3 d)}
Thus
g(x,d)3=g(3x,3d)=34(x−3d)g(3x,3d)34(x−3d)⩽3x43(x−3d)34(x−3d)=3x(6481)x−3d, g(x, d)^{3}=g(3 x, 3 d)=\frac{3^{4(x-3 d)} g(3 x, 3 d)}{3^{4(x-3 d)}} \leqslant \frac{3^{x} 4^{3(x-3 d)}}{3^{4(x-3 d)}}=3^{x}\left(\frac{64}{81}\right)^{x-3 d},
which completes the proof of the first claim. Likewise, if d⩾x/3d \geqslant x / 3,
32(3d−x)g(3x,3d)3⩽g(3x+6(3d−x),3d+2(3d−x))=g(18d−3x,9d−2x). 3^{2(3 d-x)} g(3 x, 3 d) 3 \leqslant g(3 x+6(3 d-x), 3 d+2(3 d-x))=g(18 d-3 x, 9 d-2 x) .
Again we have
2(9d−2x)⩽18−3x⩽18−3x+3(3d−x)=3(9d−2x), 2(9 d-2 x) \leqslant 18-3 x \leqslant 18-3 x+3(3 d-x)=3(9 d-2 x),
so
g(18d−3x,9d−2x)=23(9d−2x)−(18d−3x)3(18d−3x)−2(9d−2x)=23(3d−x)3x. g(18 d-3 x, 9 d-2 x)=2^{3(9 d-2 x)-(18 d-3 x)} 3^{(18 d-3 x)-2(9 d-2 x)}=2^{3(3 d-x)} 3^{x} .
Thus
g(x,d)3=g(3x,3d)=23(3d−x)g(3x,3d)32(3d−x)⩽23(3d−x)3x32(3d−x)=3x(89)3d−x g(x, d)^{3}=g(3 x, 3 d)=\frac{2^{3(3 d-x)} g(3 x, 3 d)}{3^{2(3 d-x)}} \leqslant \frac{2^{3(3 d-x)} 3^{x}}{3^{2(3 d-x)}}=3^{x}\left(\frac{8}{9}\right)^{3 d-x}
from which the second claim follows.

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.