Problem

Source: 2021 Macedonian Team Selection Test P4

Tags: combinatorics, algebra



Let $S=\{1, 2, 3, \dots 2021\}$ and $f:S \to S$ be a function such that $f^{(n)}(n)=n$ for each $n \in S$. Find all possible values for $f(2021)$. (Here, $f^{(n)}(n) = \underbrace{f(f(f\dots f(}_{n \text{ times} }n)))\dots))$.) Proposed by Viktor Simjanoski