Problem

Source: Kyiv City MO 2021 Round 1, Problem 9.4

Tags: combinatorics



You are given a positive integer $k$ and not necessarily distinct positive integers $a_1, a_2 , a_3 , \ldots, a_k$. It turned out that for any coloring of all positive integers from $1$ to $2021$ in one of the $k$ colors so that there are exactly $a_1$ numbers of the first color, $a_2$ numbers of the second color, $\ldots$, and $a_k$ numbers of the $k$-th color, there is always a number $x \in \{1, 2, \ldots, 2021\}$, such that the total number of numbers colored in the same color as $x$ is exactly $x$. What are the possible values of $k$? Proposed by Arsenii Nikolaiev