Maths Olympiad Prep

Library / /117 of 299

Combinatorics Difficulty 6.3 National Olympiad Prove it Iran

Let nn be a given positive integer. Find the number of permutations (a1,,an)(a_1, \dots, a_n) of 1,2,,n1, 2, \dots, n such that for all 1in1 \le i \le n we have ai2ia_i \mid 2i.

Solution

We shall prove that the answer is 2n22^{\lfloor \frac{n}{2} \rfloor}. We shall firstly prove the following lemma;

Lemma 1. Let i=2ν2(i)mi = 2^{\nu_2(i)}m, gcd(2,m)=1\gcd(2, m) = 1 then ai=2jma_i = 2^j m for some j{0,1,,1+ν2(i)}j \in \{0, 1, \dots, 1+\nu_2(i)\}.

Proof. We shall prove this statement through induction on mm. Notice that for m=1m=1 and for i{2j2jn,j{0,1,}}i \in \{2^j \mid 2^j \le n, j \in \{0, 1, \dots\}\}, the number aia_i would also be an element of that set. Hence, aia_i would be a permutation of {2j2jn,j{0,1,}}\{2^j \mid 2^j \le n, j \in \{0, 1, \dots\}\}

Now, let for all odd N>mN > m such, if i{2jN2jNn,j{0,1,}}i \in \{2^j N \mid 2^j N \le n, j \in \{0, 1, \dots\}\} then aia_i must be a permutation of the same set. Setting i=2ν2(i)mi = 2^{\nu_2(i)}m and ai=2jNa_i = 2^j N such that NmN \mid m and j1+ν2(i)j \le 1 + \nu_2(i). Since we have already used all the numbers with the odd parts less than mm we find that N=mN = m and we are done.

We shall now claim that after the determination of all number of the form ak=2ka_k = 2k, k=1,2,,n2k = 1, 2, \dots, \lfloor \frac{n}{2} \rfloor the permutation would indeed uniquely be determined. According to the above lemma, it only suffices to restrict ourselves to the set {2jm:2jmn,j=0,1,}\{2^j m : 2^j m \le n, j = 0, 1, \dots\}. We draw a directed graph having nn vertices that are collinear, such that the in- and out- degree of each vertex is 1 and from each vertex the out edge would either go to the next vertex or to one of the vertices before hand. Now, if we determine those vertices with the edge to the next, we can uniquely determine the other edges. For this reason, we shall prove the following lemma;

Lemma 2. *If the kk-th vertex be the first with zero out-degree, then no edge would go out of the set of vertices {1,2,,k}\{1, 2, \dots, k\}. Moreover, there is only one vertex with the zero in-degree.*

Proof. Since any edge that is out from {1,2,,k1}\{1, 2, \dots, k-1\} will go some vertex in the set {1,2,,k}\{1, 2, \dots, k\} and the kk has the out-degree to its left (otherwise its out-edge has yet been determined!). The first part of the lemma would be obvious. For the second part, regard that the sum of in-degrees and out-degrees would be equal. This completes our proof.

Thus, at each step that we face the first vertex with zero out-degree, we connect it to the previous vertex with the zero in-degree and continue this procedure. Since for each of 1,2,,n21, 2, \dots, \lfloor \frac{n}{2} \rfloor we have two choices, the final answer would be 2n22^{\lfloor \frac{n}{2} \rfloor}, as desired.

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 reproduced verbatim; metadata (topic, difficulty) added by this project.