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 4 of 5: Force equality two steps apart under a three-color assumption
f(x−5),f(x),f(x+7) are pairwise distinct,f(x+2)=f(x)f(x-5),f(x),f(x+7)\text{ are pairwise distinct},\qquad f(x+2)=f(x)
Detailed analysis

Assume a three-coloring exists. The three integers x−5,x+7,x+2x-5,x+7,x+2 have pairwise distances 12,5,512,5,5; use instead the source's first triple x−5,x,x+7x-5,x,x+7: their pairwise distances are 5,7,125,7,12, so their colors are all distinct. The point x+2x+2 is at distance 77 from x−5x-5 and 55 from x+7x+7, so it cannot use either of those two colors and must have f(x+2)=f(x)f(x+2)=f(x).