Problem

Source:

Tags: number theory, relatively prime



Let $n$ and $k$ be given relatively prime natural numbers, $k<n.$ Each number in the set $M=\{1,2,...,n-1\}$ is colored either blue or white. It is given that for each $i\in M,$ both $i$ and $n-i$ have the same color, for each $i\in M,i\ne k,$ both $i$ and $\left \vert i-k \right \vert $ have the same color. Prove that all numbers in $M$ have the same color.