Problem

Source: 2024 Turkey TST P7

Tags: combinatorics, Piegonhole, Coloring



Let $r\geq 2$ be a positive integer, and let each positive integer be painted in one of $r$ different colors. For every positive integer $n$ and every pair of colors $a$ and $b$, if the difference between the number of divisors of $n$ that are painted in color $a$ and the number of divisors of $n$ that are painted in color $b$ is at most $1$, find all possible values of $r$.