MathLabs

Problem 2

Let nn and kk be relatively prime positive integers with k<nk < n. The set M={1,2,…,n−1}M = \{1, 2, \ldots, n-1\} is colored so that each number is either blue or white, subject to: (i) for each i∈Mi \in M, the numbers ii and n−in-i have the same color; and (ii) for each i∈Mi \in M with i≠ki \ne k, the numbers ii and ∣i−k∣|i-k| have the same color. Prove that all the numbers in MM must have the same color.
Step 2 of 5: Two ways consecutive residues can differ
In plain words

Walking from one labeled point to the next around the cycle of residues, each step is a jump of size kk — except that once you pass the top of the cycle (nn), you land nn lower than the plain sum suggests.

ri+1=ri+korri+1=ri+k−nr_{i+1} = r_i + k \quad\text{or}\quad r_{i+1} = r_i + k - n
Detailed analysis

By definition ri+1−ri≡k(modn)r_{i+1}-r_i \equiv k \pmod n, and since both ri,ri+1∈{1,…,n−1}r_i,r_{i+1}\in\{1,\dots,n-1\}, the actual (non-modular) difference is either exactly kk, or k−nk-n (when adding kk overshoots past nn and wraps around).