Let p be an odd prime, and put N=41(p3−p)−1. The numbers 1,2,…,N are painted arbitrarily in two colors, red and blue. For any positive integer n⩽N, denote r(n) the fraction of integers {1,2,…,n} that are red.
Prove that there exists a positive integer a∈{1,2,…,p−1} such that r(n)=a/p for all n=1,2,…,N.[I]Netherlands IMO ShortlistcombinatoricsIMO Shortlist 2020colorings