MathLabs

Problem 5

Find the minimum positive integer kk for which there exists a function f:Z→{1,2,…,k}f:\mathbb Z\to\{1,2,\dots,k\} such that f(x)≠f(y)f(x)\ne f(y) whenever ∣x−y∣∈{5,7,12}|x-y|\in\{5,7,12\}.
Step 5 of 5: Contradict the distance-twelve condition
f(x)=f(x+2)=⋯=f(x+12),∣(x+12)−x∣=12f(x)=f(x+2)=\cdots=f(x+12),\qquad |(x+12)-x|=12
Detailed analysis

Iterating f(x+2)=f(x)f(x+2)=f(x) gives equality along the six increments from xx to x+12x+12. But the defining condition requires f(x)≠f(x+12)f(x)\ne f(x+12) because their distance is 1212. Thus three colors are impossible, so k≥4k\ge4; together with the construction, k=4k=4.