Maths Olympiad Prep

Track / Stage 6 / 387 of 400 #2027 of 2604

Problem 2027

National Olympiad, first round
Combinatorics Difficulty 6.9 Prove it Saudi Arabian Mathematical Competitions · Saudi Arabia

Let pp be an odd prime and let N=14(p3−p)−1N = \frac{1}{4}(p^3 - p) - 1. The numbers 1,2,…,N1, 2, \dots, N are painted arbitrarily in two colors, red and blue. For any positive integer n≤Nn \le N, denote by r(n)r(n) the fraction of integers in {1,2,…,n}\{1, 2, \dots, n\} that are red (number of red numbers divided by nn). Prove that there exists a positive integer a∈{1,2,…,p−1}a \in \{1, 2, \dots, p-1\} such that r(n)≠apr(n) \ne \frac{a}{p} for all n=1,2,…,Nn = 1, 2, \dots, N

This one wants a proof. Work it on paper, then read the official solution and mark yourself. Be honest about it: the record is only any use to you if it is.

Next problem →

Official solution

Denote by R(n)R(n) the number of red numbers in {1,2,…,n}\{1, 2, \dots, n\}, i.e., R(n)=nr(n)R(n) = n r(n). Similarly, denote by B(n)B(n) and b(n)=B(n)/nb(n) = B(n)/n the number and proportion of blue numbers in {1,2,…,n}\{1, 2, \dots, n\}, respectively. Notice that B(n)+R(n)=nB(n) + R(n) = n and b(n)+r(n)=1b(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}a \in \{1, 2, \dots, p-1\} choose some positive integer nan_a such that r(na)=a/pr(n_a) = a/p and, hence, R(na)=ana/pR(n_a) = a n_a / p. Clearly, p∣nap \mid n_a, so that na=pman_a = p m_a for some positive integer mam_a, and R(na)=amaR(n_a) = a m_a. Without loss of generality, we assume that m1<mp−1m_1 < m_{p-1}, as otherwise one may swap the colors. Notice that
ma≤Np<p2−14for all a=1,2,…,p−1. m_a \le \frac{N}{p} < \frac{p^2-1}{4} \quad \text{for all } a=1,2,\dots,p-1.
The solution is based on a repeated application of the following simple observation.

Claim. Assume that ma<mbm_a < m_b for some a,b∈{1,2,…,p−1}a, b \in \{1, 2, \dots, p-1\}. Then
mb≥abmaandmb≥p−ap−bma. m_b \ge \frac{a}{b} m_a \quad \text{and} \quad m_b \ge \frac{p-a}{p-b} m_a.
Proof. The first inequality follows from bmb=R(nb)≥R(na)=amab m_b = R(n_b) \ge R(n_a) = a m_a. The second inequality is obtained by swapping colors.

Let q=(p−1)/2q = (p-1)/2. We distinguish two cases.

Case 1: All qq numbers m1,m2,…,mqm_1, m_2, \dots, m_q are smaller than mp−1m_{p-1}.
Let mam_a be the maximal number among m1,m2,…,mqm_1, m_2, \dots, m_q; then ma≥q≥am_a \ge q \ge a. Applying the Claim, we get
mp−1≥p−ap−(p−1)ma≥(p−q)q=p2−14 m_{p-1} \ge \frac{p-a}{p-(p-1)} m_a \ge (p-q)q = \frac{p^2-1}{4}
which contradicts (1).

Case 2: There exists k≤qk \le q such that mk>mp−1m_k > m_{p-1}. Choose kk to be the smallest index satisfying mk>mp−1m_k > m_{p-1}; by our assumptions, we have 1<k≤q<p−11 < k \le q < p-1.
Let mam_a be the maximal number among m1,m2,…,mk−1m_1, m_2, \dots, m_{k-1}; then a≤k−1≤ma<mp−1a \le k-1 \le m_a < m_{p-1}. Applying the Claim, we get
mk≥p−1kmp−1≥p−1k⋅p−ap−(p−1)ma≥p−1k⋅(p−k+1)(k−1)≥k−1k⋅(p−1)(p−q)≥12⋅p2−12 \begin{align*} m_k &\ge \frac{p-1}{k} m_{p-1} \ge \frac{p-1}{k} \cdot \frac{p-a}{p-(p-1)} m_a \\ &\ge \frac{p-1}{k} \cdot (p-k+1)(k-1) \\ &\ge \frac{k-1}{k} \cdot (p-1)(p-q) \\ &\ge \frac{1}{2} \cdot \frac{p^2-1}{2} \end{align*}
which contradicts (1) again. □\square

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty, ordering) added by this project.