Maths Olympiad Prep

Library / /156 of 520

Combinatorics Difficulty 6.1 National olympiad Find the answer

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

A number or a short expression. Spacing and $ signs are ignored.

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=1,F2=2,F3=6F_{1}=1, F_{2}=2, F_{3}=6. Take an n>3n>3 and consider any nice permutation (a1,a2,,an)\left(a_{1}, a_{2}, \ldots, a_{n}\right) 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\left(a_{1}+a_{2}+\cdots+a_{n-1}\right)=2\left((1+2+\cdots+n)-a_{n}\right) \\ & \quad=n(n+1)-2 a_{n}=(n+2)(n-1)+\left(2-2 a_{n}\right) . \end{aligned}
So 2an22 a_{n}-2 must be divisible by n1n-1, hence equal to 0 or n1n-1 or 2n22 n-2. This means that
an=1 or an=n+12 or an=n a_{n}=1 \quad \text { or } \quad a_{n}=\frac{n+1}{2} \quad \text { or } \quad a_{n}=n \text {. }
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\left(a_{1}+a_{2}+\cdots+a_{n-2}\right) & =2\left((1+2+\cdots+n)-a_{n}-a_{n-1}\right) \\ & =n(n+1)-(n+1)-2 a_{n-1}=(n+2)(n-2)+\left(3-2 a_{n-1}\right) . \end{aligned}
So 2an132 a_{n-1}-3 should be divisible by n2n-2, hence equal to 0 or n2n-2 or 2n42 n-4. Obviously 0 and 2n42 n-4 are excluded because 2an132 a_{n-1}-3 is odd. The remaining possibility (2an13=n2)\left(2 a_{n-1}-3=n-2\right) 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)\left(a_{1}, a_{2}, \ldots, a_{n-1}\right) 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)\left(a_{1}-1, a_{2}-1, \ldots, a_{n-1}-1\right) 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\left(\left(a_{1}-1\right)+\cdots+\left(a_{k}-1\right)\right)=2\left(a_{1}+\cdots+a_{k}\right)-2 k
is divisible by kk, for any kn1k \leq n-1. And again, any one of the Fn1F_{n-1} nice permutations (b1,b2,,bn1)\left(b_{1}, b_{2}, \ldots, b_{n-1}\right) 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 1, namely (b1+1,b2+1,,bn1+1,1)\left(b_{1}+1, b_{2}+1, \ldots, b_{n-1}+1,1\right).
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 1 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.

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: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic and difficulty added by this site.