Maths Olympiad Prep

Library / /99 of 106

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+jni+j \leqslant n, then ai+ajna_{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/2k=\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 aiia_{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 iki \leqslant k, then aika_{i} \leqslant k.
Proof. We have i+ini+i \leqslant n, so ai+aina_{i}+a_{i} \leqslant n whence aika_{i} \leqslant k.

Lemma 3. There exist r,sr, s such that ar=asa_{r}=a_{s} and rsr \neq s.
Proof. If a00a_{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 aiia_{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,vru, v \geqslant r and dvud \mid v-u.
2. ai=ia_{i}=i for i<ri<r and aira_{i} \geqslant r for iri \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 ru0,v0<r+dr \leqslant u_{0}, v_{0}<r+d such that duu0,vv0d \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+u0v0=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 duvd \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. daiid \mid a_{i}-i for all ii, or
2. r=0r=0 and daiid/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 duvd \mid u-v. Since aai+a0=aia_{a_{i}+a_{0}}=a_{i} for all ii, we have daii+a0d \mid a_{i}-i+a_{0}. For i=0i=0, this means that d2a0d \mid 2 a_{0}. If da0d \mid a_{0} then that means that daiid \mid a_{i}-i for all ii. Otherwise, if da0d \nmid a_{0}, then da0d/2d \mid a_{0}-d / 2 and thus daiid/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 da0d/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 dk+1d \leqslant k+1, then by Lemma 2, (a0,,ad1)(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 aika_{i} \leqslant k for all ii by induction. Note that Lemma 2 already establishes this for iki \leqslant k. We must have dad/2d \mid a_{d / 2} and ad/2k<da_{d / 2} \leqslant k<d so ad/2=0a_{d / 2}=0. Thus, for i>ki>k, if ajka_{j} \leqslant k for j<ij<i, then aid/2ka_{i-d / 2} \leqslant k, so ai=a(id/2)+d/2=aaid/2ka_{i}=a_{(i-d / 2)+d / 2}=a_{a_{i-d / 2}} \leqslant k.

Lemma 7. If (ai)(a_{i}) is small, then r+dk+1r+d \leqslant k+1.
Proof. Since (ai)(a_{i}) is small, there exists u,vk+1u, v \leqslant k+1 such that u<vu<v and au=ava_{u}=a_{v}. Thus uru \leqslant r and dvud \mid v-u, so r+dvk+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 0i<r+d0 \leqslant i<r+d.
Proof. Since (ai)(a_{i}) is large and has period dd and offset rr, the period (ar,,ar+d1)(a_{r}, \ldots, a_{r+d-1}) must have an element that is larger than kk, so by Lemma 2 we must have r+d1>kr+d-1>k.
We already have ai=ia_{i}=i for i<ri<r. Now we show that ai=ia_{i}=i for rikr \leqslant i \leqslant k. By Lemma 6 we have daiid \mid a_{i}-i but rikr \leqslant i \leqslant k. Since kr+1>dk-r+1>d, this means that ai=ia_{i}=i for iki \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 aiia_{i} \geqslant i (otherwise ai=aja_{i}=a_{j} for some j<ij<i, but then rjr \leqslant j and i<r+di<r+d means that djid \nmid j-i.) However, ai+(ni)=ai+anina_{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 (nk1)(n+k+2)/2(n-k-1)(n+k+2) / 2 possible choices of (r,d)(r, d) where 0r<n,d10 \leqslant r<n, d \geqslant 1, and k+1<r+dnk+1<r+d \leqslant n.

For small sequences, for a given period dd and offset rr, we need to choose the period (ar,,ar+d1)(a_{r}, \ldots, a_{r+d-1}) satisfying rajkr \leqslant a_{j} \leqslant k and dajjd \mid a_{j}-j for rj<r+dr \leqslant j<r+d. There are g(k+1r,d)g(k+1-r, d) such choices, where we define g(x,d)g(x, d) to be (p+1)qpdq(p+1)^{q} p^{d-q} with p=x/dp=\lfloor x / d\rfloor and q=xdpq=x-d p.

Furthermore, if dd is even then there are g(k+1,d)g(k+1, d) choices for the period (a0,,ad1)(a_{0}, \ldots, a_{d-1}) satisfying dajjd/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+(nk1)(n+k+2)2+d=1(k+1)/2g(k+1,2d)+r=0kd=1k+1rg(k+1r,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/61. 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/3d, if dx/3;3x/3(89)dx/3, if dx/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 2dx3d2 d \leqslant x \leqslant 3 d, then g(x,d)=23dx3x2dg(x, d)=2^{3 d-x} 3^{x-2 d}. Likewise, if 3dx4d3 d \leqslant x \leqslant 4 d then g(x,d)=34dx4x3dg(x, d)= 3^{4 d-x} 4^{x-3 d}.

With these observations, if dx/3d \leqslant x / 3, then
34(x3d)g(3x,3d)g(3x+12(x3d),3d+4(x3d))=g(15x36d,4x9d) 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(15x36d,4x9d)g(15 x-36 d, 4 x-9 d), note that
3(4x9d)=12x27d15x36d,4(4x9d)=16x36d15x36d, \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(15x36d,4x9d)=34(4x9d)(15x36d)4(15x36d)3(4x9d)=3x43(x3d) 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(x3d)g(3x,3d)34(x3d)3x43(x3d)34(x3d)=3x(6481)x3d, 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 dx/3d \geqslant x / 3,
32(3dx)g(3x,3d)3g(3x+6(3dx),3d+2(3dx))=g(18d3x,9d2x). 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(9d2x)183x183x+3(3dx)=3(9d2x), 2(9 d-2 x) \leqslant 18-3 x \leqslant 18-3 x+3(3 d-x)=3(9 d-2 x),
so
g(18d3x,9d2x)=23(9d2x)(18d3x)3(18d3x)2(9d2x)=23(3dx)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(3dx)g(3x,3d)32(3dx)23(3dx)3x32(3dx)=3x(89)3dx 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,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.