Problem

Source: Romanian TST 2002

Tags: function, modular arithmetic, combinatorics proposed, combinatorics



Let $f:\mathbb{Z}\rightarrow\{ 1,2,\ldots ,n\}$ be a function such that $f(x)\not= f(y)$, for all $x,y\in\mathbb{Z}$ such that $|x-y|\in\{2,3,5\}$. Prove that $n\ge 4$. Ioan Tomescu