Problem

Source: Rio de Janeiro Mathematical Olympiad 2018, Level 4, #3

Tags: function, combinatorics



Let $n$ and $k$ be positive integers. A function $f : \{1, 2, 3, 4, \dots , kn - 1, kn\} \to \{1, \cdots , 5\}$ is good if $f(j + k) - f(j)$ is multiple of $k$ for every $j = 1, 2. \cdots , kn - k$. (a) Prove that, if $k = 2$, then the number of good functions is a perfect square for every positive integer $n$. (b) Prove that, if $k = 3$, then the number of good functions is a perfect cube for every positive integer $n$.