Maths Olympiad Prep

Library / USA Team Selection Test /16 of 33

USA Team Selection Test

Combinatorics Difficulty 8.0 Shortlist Find the answer

Assume nn is a positive integer. Considers sequences a0,a1,…,ana_0, a_1, \ldots, a_n for which ai∈{1,2,…,n}a_i \in \{1, 2, \ldots , n\} for all ii and an=a0a_n = a_0.

(a) Suppose nn is odd. Find the number of such sequences if ai−ai−1≢i(modn)a_i - a_{i-1} \not \equiv i \pmod{n} for all i=1,2,…,ni = 1, 2, \ldots, n.

(b) Suppose nn is an odd prime. Find the number of such sequences if ai−ai−1≢i,2i(modn)a_i - a_{i-1} \not \equiv i, 2i \pmod{n} for all i=1,2,…,ni = 1, 2, \ldots, n.

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Solution

Let n n be a positive integer. Consider sequences a0,a1,…,an a_0, a_1, \ldots, a_n for which ai∈{1,2,…,n} a_i \in \{1, 2, \ldots , n\} for all i i and an=a0 a_n = a_0 .

### Part (a)
Suppose n n is odd. We need to find the number of such sequences if ai−ai−1≢i(modn) a_i - a_{i-1} \not\equiv i \pmod{n} for all i=1,2,…,n i = 1, 2, \ldots, n .

Using the principle of inclusion-exclusion, we start by considering the number of ways to choose k k of the conditions to be disregarded. There are (nk) \binom{n}{k} ways to choose k k conditions. Each condition synchronizes two neighboring entries in the sequence, resulting in n−k n-k groups of entries that move together. There are nn−k n^{n-k} possibilities for these groups.

For k=n k = n , we must have 1+2+⋯+n=n(n+1)2≡0(modn) 1 + 2 + \dots + n = \frac{n(n+1)}{2} \equiv 0 \pmod{n} , which is true for odd n n . There are n n possibilities in this case.

Thus, the number of sequences is given by:
∑k=0n(−1)k(nk)nn−k−(n−1). \sum_{k=0}^{n} (-1)^k \binom{n}{k} n^{n-k} - (n-1).

Using the binomial theorem, this simplifies to:
(n−1)n−(n−1). (n-1)^n - (n-1).

### Part (b)
Suppose n n is an odd prime. We need to find the number of such sequences if ai−ai−1≢i,2i(modn) a_i - a_{i-1} \not\equiv i, 2i \pmod{n} for all i=1,2,…,n i = 1, 2, \ldots, n .

We extend the previous method by choosing k k places where we disregard the condition, but now we have two possibilities for each place. The condition for i=n i = n counts as one condition, so we need two terms for each k k to distinguish whether i=n i = n is involved or not.

For k<n k < n , the sum is:
∑k=0n−1((−1)k(n−1k)2knn−k+(−1)k(n−1k−1)2k−1nn−k). \sum_{k=0}^{n-1} \left( (-1)^k \binom{n-1}{k} 2^k n^{n-k} + (-1)^k \binom{n-1}{k-1} 2^{k-1} n^{n-k} \right).

This simplifies to:
n(n−2)n−1−(n−2)n−1=(n−1)(n−2)n−1. n(n-2)^{n-1} - (n-2)^{n-1} = (n-1)(n-2)^{n-1}.

For k=n k = n , we need to find the number of ways to choose ϵi∈{1,2} \epsilon_i \in \{1, 2\} such that ∑i=1nϵii≡0(modn) \sum_{i=1}^{n} \epsilon_i i \equiv 0 \pmod{n} . Since n n is odd, this reduces to finding subsets S S of {1,2,…,n} \{1, 2, \ldots, n\} with ∑x∈Sx≡0(modn) \sum_{x \in S} x \equiv 0 \pmod{n} . This is true if S S contains all or none of the elements. For other sets, we consider shifts of S S by adding i i to each entry of S S . Since n n is prime, the sequence of shifted sets has period n n , and we get each residue mod n n exactly once.

Thus, there are 2+2n−2n 2 + \frac{2^n - 2}{n} such sets. Dividing by two (since ϵn \epsilon_n is the same in both cases), we get:
2+2n−2n2=1+2n−1−1n. \frac{2 + \frac{2^n - 2}{n}}{2} = 1 + \frac{2^{n-1} - 1}{n}.

Therefore, the number of sequences is:
(n−1)(n−2)n−1−(1+2n−1−1n). (n-1)(n-2)^{n-1} - \left( 1 + \frac{2^{n-1} - 1}{n} \right).

The answer is:
(n−1)(n−2)n−1−2n−1−1n−1. \boxed{(n-1)(n-2)^{n-1} - \frac{2^{n-1} - 1}{n} - 1}.

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

Source: Omni-MATH, licensed Apache-2.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.