Maths Olympiad Prep

Library / HMMT February /505 of 1302

HMMT February

Combinatorics Difficulty 5.2 AIME, harder Find the answer

Let S={1,2,…,9}S=\{1,2, \ldots, 9\}. Compute the number of functions f:S→Sf: S \rightarrow S such that, for all s∈S,f(f(f(s)))=ss \in S, f(f(f(s)))=s and f(s)−sf(s)-s is not divisible by 3.

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

Solution

Since f(f(f(s)))=sf(f(f(s)))=s for all s∈Ss \in S, each cycle in the cycle decomposition of ff must have length 1 or 3. Also, since f(s)≢s mod 3f(s) \not \equiv s \bmod 3 for all s∈Ss \in S, each cycle cannot contain two elements a,ba, b such that a=b mod 3a=b \bmod 3. Hence each cycle has exactly three elements, one from each of residue classes mod 3. In particular, 1,4,71,4,7 belong to distinct cycles. There are 6⋅36 \cdot 3 ways to choose two other numbers in the cycle containing 1. Then, there are 4⋅24 \cdot 2 ways to choose two other numbers in the cycle containing 4. Finally, there are 2⋅12 \cdot 1 ways to choose two other numbers in the cycle containing 7. Hence the desired number of functions ff is 6⋅3⋅4⋅2⋅2⋅1=2886 \cdot 3 \cdot 4 \cdot 2 \cdot 2 \cdot 1=288.

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.