Olympiad Maths Prep

Track / Stage 8 / 136 of 180 #1836 of 2000

Problem 1836

IMO Shortlist mid-range; USAMO P2/P5
Combinatorics Difficulty 8.7 Prove it 49th International Mathematical Olympiad Spain · IMO

For every positive integer nn determine the number of permutations (a1,a2,,an)(a_{1}, a_{2}, \ldots, a_{n}) of the set {1,2,,n}\{1,2, \ldots, n\} with the following property:
2(a1+a2++ak)is divisible by kfor k=1,2,,n. 2(a_{1}+a_{2}+\cdots+a_{k}) \quad \text{is divisible by} \ k \quad \text{for} \ k=1,2, \ldots, n.

This one wants a proof. Work it on paper, read the official solution, then mark yourself honestly — the ladder only means something if the record is true.

Official solution

For each nn let FnF_{n} be the number of permutations of {1,2,,n}\{1,2, \ldots, n\} with the required property; call them nice. For n=1,2,3n=1,2,3 every permutation is nice, so F1=1F_{1}=1, F2=2F_{2}=2, F3=6F_{3}=6.

Take an n>3n>3 and consider any nice permutation (a1,a2,,an)(a_{1}, a_{2}, \ldots, a_{n}) of {1,2,,n}\{1,2, \ldots, n\}. Then n1n-1 must be a divisor of the number
2(a1+a2++an1)=2((1+2++n)an)=n(n+1)2an=(n+2)(n1)+(22an). \begin{aligned} & 2(a_{1}+a_{2}+\cdots+a_{n-1})=2((1+2+\cdots+n)-a_{n}) \\ & \quad=n(n+1)-2 a_{n}=(n+2)(n-1)+(2-2 a_{n}) . \end{aligned}
So 2an22 a_{n}-2 must be divisible by n1n-1, hence equal to 00 or n1n-1 or 2n22 n-2. This means that
an=1oran=n+12oran=n a_{n}=1 \quad \text{or} \quad a_{n}=\frac{n+1}{2} \quad \text{or} \quad a_{n}=n
Suppose that an=(n+1)/2a_{n}=(n+1)/2. Since the permutation is nice, taking k=n2k=n-2 we get that n2n-2 has to be a divisor of
2(a1+a2++an2)=2((1+2++n)anan1)=n(n+1)(n+1)2an1=(n+2)(n2)+(32an1) \begin{aligned} 2(a_{1}+a_{2}+\cdots+a_{n-2}) & =2((1+2+\cdots+n)-a_{n}-a_{n-1}) \\ & =n(n+1)-(n+1)-2 a_{n-1}=(n+2)(n-2)+(3-2 a_{n-1}) \end{aligned}
So 2an132 a_{n-1}-3 should be divisible by n2n-2, hence equal to 00 or n2n-2 or 2n42 n-4. Obviously 00 and 2n42 n-4 are excluded because 2an132 a_{n-1}-3 is odd. The remaining possibility (2an13=n22 a_{n-1}-3=n-2) leads to an1=(n+1)/2=ana_{n-1}=(n+1)/2=a_{n}, which also cannot hold. This eliminates (n+1)/2(n+1)/2 as a possible value of ana_{n}. Consequently an=1a_{n}=1 or an=na_{n}=n.

If an=na_{n}=n then (a1,a2,,an1)(a_{1}, a_{2}, \ldots, a_{n-1}) is a nice permutation of {1,2,,n1}\{1,2, \ldots, n-1\}. There are Fn1F_{n-1} such permutations. Attaching nn to any one of them at the end creates a nice permutation of {1,2,,n}\{1,2, \ldots, n\}.

If an=1a_{n}=1 then (a11,a21,,an11)(a_{1}-1, a_{2}-1, \ldots, a_{n-1}-1) is a permutation of {1,2,,n1}\{1,2, \ldots, n-1\}. It is also nice because the number
2((a11)++(ak1))=2(a1++ak)2k 2((a_{1}-1)+\cdots+(a_{k}-1))=2(a_{1}+\cdots+a_{k})-2k
is divisible by kk, for any kn1k \leq n-1. And again, any one of the Fn1F_{n-1} nice permutations (b1,b2,,bn1)(b_{1}, b_{2}, \ldots, b_{n-1}) of {1,2,,n1}\{1,2, \ldots, n-1\} gives rise to a nice permutation of {1,2,,n}\{1,2, \ldots, n\} whose last term is 11, namely (b1+1,b2+1,,bn1+1,1)(b_{1}+1, b_{2}+1, \ldots, b_{n-1}+1, 1).

The bijective correspondences established in both cases show that there are Fn1F_{n-1} nice permutations of {1,2,,n}\{1,2, \ldots, n\} with the last term 11 and also Fn1F_{n-1} nice permutations of {1,2,,n}\{1,2, \ldots, n\} with the last term nn. Hence follows the recurrence Fn=2Fn1F_{n}=2 F_{n-1}. With the base value F3=6F_{3}=6 this gives the outcome formula Fn=32n2F_{n}=3 \cdot 2^{n-2} for n3n \geq 3.

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