Maths Olympiad Prep

Library / /454 of 462

Combinatorics Difficulty 7.6 National Olympiad, round 2 Prove it Ireland

In a mathematics class, the teacher shows an apparatus containing nn switches, where each switch can be in any of three positions, labelled 1–3, and n>1n > 1. Initially, all switches are in position 1, and we need to move the switches so that all are in position 2. The teacher shows one method of doing this that involves exactly n+1n + 1 steps, where each step changes the position of exactly one switch.
Let cnc_n be the number of (n+1)(n+1)-step methods for altering the apparatus in this way, not including the teacher's method. Two methods are the same only if they involve the same steps in the same order. Show that cnc_n has no factor kk satisfying 1<k<n+21 < k < n+2, and that n+2n+2 is a factor of cnc_n if and only if n+2n+2 is prime.

Solution

We provide three methods to show that cn=n(n+1)!/21c_n = n \cdot (n+1)!/2 - 1 for all nNn \in \mathbb{N}.
(We omit the assumption n>1n > 1 when proving this.) Let dn:=cn+1d_n := c_n + 1, i.e. dnd_n
is the number of (n+1)(n+1)-step methods including that of the teacher.

Method 1. Consider the first step of any (n+1)(n + 1)-step method. If this involves moving some switch s1s_1 to position 2, we call it a Type A step. After we perform a Type A step on s1s_1, we cannot subsequently move s1s_1 since we would later need to move it back again to position 2, thereby “wasting” two steps when we only have a single step to spare. Our only option therefore is to use the remaining nn steps to change the other n1n-1 switches from position 1 to position 2. This can be done in dn1d_{n-1} ways. Since there are nn choices for the initial switch s1s_1, we get a total of ndn1nd_{n-1} methods that start with a Type A step.
Alternatively, if the first step moves a switch to position 3, we call it a Type B step. After a Type B step, all nn switches are in the wrong position, so each subsequent step must consist of changing a switch to position 2. Thus, the only choices involve the order in which we carry out these moves, giving a total of n!n! methods that start with the given Type B step. Since there are nn choices for the initial switch s1s_1, there are nn!n \cdot n! methods that start with a Type B step.

Rewriting these equations in terms of en:=dn/n!e_n := d_n/n!, we get en=en1+ne_n = e_{n-1} + n for
all n>1n > 1, and e1=1e_1 = 1. Thus, en=n(n+1)/2e_n = n(n+1)/2 and dn=n(n+1)!/2d_n = n \cdot (n+1)!/2. This
finishes the proof of our claim.

Method 2. First note that in each (n+1)(n+1)-step method, exactly one switch will first be switched to 3 and then to 2, whereas all others have to be switched to 2 directly. If we ignore this extra initial switching to 3, each (n+1)(n+1)-step method gives rise to an nn-step method, which is just an ordering of the switches; and there are n!n! of them.

For how many different (n+1)(n + 1)-step methods do we get to the same nn-step
method (or ordering of switches)? The answer is 1+2+3+...+n1+2+3+...+n, because the
switch which is the kk-th which is switched to 2 in the nn-step method, could be switched to 3 any time before it is switched to 2, and there are kk opportunities to do so. The conclusion is that dn=n!n(n+1)/2=n(n+1)!/2d_n = n! \cdot n \cdot (n+1)/2 = n \cdot (n+1)!/2.

Method 3. Exactly one switch has to be touched twice. If this is switch kk, then we are seeking the number of ways to permute the numbers
1,2,3,,k1,k,k,k+1,,n, 1, 2, 3, \dots, k-1, k, k, k+1, \dots, n,
which is (n+1)!/2(n+1)!/2. Taking into account all nn values of kk yields a total of dn=n(n+1)!/2d_n = n \cdot (n+1)!/2.

We now prove the divisibility statements about cn=n(n+1)!/21c_n = n \cdot (n+1)!/2 - 1. Since (n+1)!(n+1)! is even for all n>0n > 0, cnc_n is an integer. Since n>1n > 1 by assumption, cn>0c_n > 0. (Of course, this is also clear in terms of the combinatorial meaning.) To show that cnc_n is not divisible by any integer 1<k<n+21 < k < n + 2, it suffices to prove this under the additional assumption that kk is prime.
If nn is even, cn=n2(n+1)!11(modk)c_n = \frac{n}{2} \cdot (n+1)! - 1 \equiv -1 \pmod{k} for any integer 1<k<n+21 < k < n+2. If nn is odd, n+1>2n+1 > 2 is even hence not prime. Thus, any prime kk that satisfies 1<k<n+21 < k < n + 2, is a factor of n!n! and so cannot divide cn=n+12nn!1c_n = \frac{n+1}{2} \cdot n \cdot n! - 1.

It remains to consider divisibility by n+2n+2. If n+2n+2 is not prime, then it has a prime factor kk less than n+2n+2. By the above, cnc_n is not divisible by kk, and so it is not divisible by n+2n+2.
Suppose finally that p:=n+2>3p := n + 2 > 3 is prime. By Wilson's theorem,
(n+1)!1(modp). (n + 1)! \equiv -1 \pmod{p}.
Since also n2(modp)n \equiv -2 \pmod{p}, the equation 2dn=n(n+1)!2d_n = n(n+1)! implies that
2dn(2)(1)2(modp), 2d_n \equiv (-2)(-1) \equiv 2 \pmod{p},
and so dn1(modp)d_n \equiv 1 \pmod{p}, because gcd(2,p)=1\gcd(2, p) = 1. Thus, p=n+2p = n + 2 divides cn=dn1c_n = d_n - 1 as required.

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.