Denote by R(n) the number of red numbers in {1,2,…,n}, i.e., R(n)=nr(n). Similarly, denote by B(n) and b(n)=B(n)/n the number and proportion of blue numbers in {1,2,…,n}, respectively. Notice that B(n)+R(n)=n and b(n)+r(n)=1. Therefore, the statement of the problem does not change after swapping the colors. Arguing indirectly, for every a∈{1,2,…,p−1} choose some positive integer na such that r(na)=a/p and, hence, R(na)=ana/p. Clearly, p∣na, so that na=pma for some positive integer ma, and R(na)=ama. Without loss of generality, we assume that m1mp−1. Choose k to be the smallest index satisfying mk>mp−1; by our assumptions, we have 1<k⩽q<p−1. Let ma be the maximal number among m1,m2,…,mk−1; then a⩽k−1⩽ma<mp−1. Applying the Claim, we get mk⩾kp−1mp−1⩾kp−1⋅p−(p−1)p−ama⩾kp−1⋅(p−k+1)(k−1)⩾kk−1⋅(p−1)(p−q)⩾21⋅2p2−1 which contradicts (1) again. Comment 1. The argument in Case 2, after a slight modification of estimates at the end, applies as soon as there exists k<43(p+1) with ak<ap−1. However, this argument does not seem to work if there is no such k. Comment 2. If p is small enough, then one can color {1,2,…,N+1} so that there exist numbers m1, m2,…,mp−1 satisfying r(pma)=a/p. For p=3,5,7, one can find colorings providing the following sequences: (m1,m2)=(1,2),(m1,m2,m3,m4)=(1,2,3,6), and (m1,…,m6)=(1,2,3,4,6,12) respectively. Thus, for small values of p, the number N in the problem statement cannot be increased. However, a careful analysis of the estimates shows that this number can be slightly increased for p⩾11.