Maths Olympiad Prep

Track / Stage 7 / 103 of 300 #2143 of 2604

Problem 2143

National Olympiad second round; IMO P1/P4
Number theory Difficulty 7.3 Prove it CMO · China · 2024

We say a prime number pp is “good”, if there exists a bijection ff from the set {0,1,…,p−1}\{0, 1, \dots, p-1\} to itself satisfying the following condition: for any pair of elements a,b∈{0,1,…,p−1}a, b \in \{0, 1, \dots, p-1\}, if p∣a2−bp \mid a^2 - b, then ∣f(a)−f(b)∣≤2024|f(a) - f(b)| \le 2024. If no such bijection ff exists, we say that the prime pp is “bad”.

Prove that there exist infinitely many good primes, and there exist infinitely many bad primes.

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

Proof. First, we show that there are infinitely many good primes. It is well-known that there are infinitely many primes p≡3(mod4)p \equiv 3 \pmod 4. We prove that if p≡3(mod4)p \equiv 3 \pmod 4, then pp is a good prime. Let f(0)=0f(0) = 0. Consider all quadratic residues of pp, denoted as r1,r2,…,r(p−1)/2r_1, r_2, \dots, r_{(p-1)/2}. If ri2≡rj(modp)r_i^2 \equiv r_j \pmod p, we draw a directed edge from rir_i to rjr_j. If i=ji = j, it is considered a self-loop. Then all vertices r1,r2,…,rp−1r_1, r_2, \dots, r_{p-1} in this directed graph have an out-degree of 1. Moreover, for any rir_i, let d2≡ri(modp)d^2 \equiv r_i \pmod p. Since (−1p)=−1\left(\frac{-1}{p}\right) = -1, either dd or −d-d (but not both) is a quadratic residue modulo pp. Thus, every vertex also has an in-degree of 1. This means the directed graph is a disjoint union of cycles.

For a directed cycle ri1→ri2→⋯→ris→ri1r_{i_1} \to r_{i_2} \to \dots \to r_{i_s} \to r_{i_1}:
- If s=2t+1s = 2t + 1 (odd), we define
f(ri1)=2u, f(ri2)=2u+4, …, f(rit+1)=2u+4t, f(rit+2)=2u+4t−2, …, f(ri2t+1)=2u+2. f(r_{i_1}) = 2u,\ f(r_{i_2}) = 2u+4,\ \dots,\ f(r_{i_{t+1}}) = 2u+4t,\ f(r_{i_{t+2}}) = 2u+4t-2,\ \dots,\ f(r_{i_{2t+1}}) = 2u+2.
- If s=2ts = 2t (even), we define
f(ri1)=2u, f(ri2)=2u+4, …, f(rit+1)=2u+4t−4, f(rit+2)=2u+4t−2, …, f(ri2t)=2u+2. f(r_{i_1}) = 2u,\ f(r_{i_2}) = 2u+4,\ \dots,\ f(r_{i_{t+1}}) = 2u+4t-4,\ f(r_{i_{t+2}}) = 2u+4t-2,\ \dots,\ f(r_{i_{2t}}) = 2u+2.
Here, uu is any integer. Since each cycle uses a consecutive sequence of even numbers, we can choose these numbers appropriately to ensure that the values used by different cycles do not overlap. Notice that only even numbers are used. If ww is not a quadratic residue, let v=w2(modp)v = w^2 \pmod p, and define f(w)=f(v)−1f(w) = f(v) - 1. This ensures that ff remains injective and satisfies ∣f(a)−f(b)∣≤2024|f(a) - f(b)| \le 2024 whenever p∣a2−bp \mid a^2 - b. Therefore, all primes p≡3(mod4)p \equiv 3 \pmod 4 are good primes.

Next, we prove that there are infinitely many bad primes. It is well-known that for any positive integer nn, if an odd prime pp divides A2n+1A^{2n} + 1 (where AA is an integer), then p≡1(mod2n+1)p \equiv 1 \pmod{2^{n+1}}. This is because ordp(A)∣2n+1\text{ord}_p(A) \mid 2^{n+1} but ordp(A)∤2n\text{ord}_p(A) \nmid 2^n, so ordp(A)=2n+1\text{ord}_p(A) = 2^{n+1}. Thus, there are infinitely many odd primes p≡1(mod2n+1)p \equiv 1 \pmod{2^{n+1}}. (If there were only finitely many, let AA be twice the product of these primes, which leads to a contradiction.)

Now, let p≡1(mod2100)p \equiv 1 \pmod{2^{100}}. We prove that pp is a bad prime. By the existence of primitive roots, the equation x2100≡1(modp)x^{2^{100}} \equiv 1 \pmod p has exactly 21002^{100} solutions modulo pp. If there exists an injective function ff satisfying the problem's conditions, then for all xx satisfying x2100≡1(modp)x^{2^{100}} \equiv 1 \pmod p and x∈{1,2,…,p−1}x \in \{1, 2, \dots, p-1\}, we must have ∣f(x)−f(1)∣≤2024×100|f(x)-f(1)| \le 2024 \times 100. However, there are 21002^{100} such xx, while the interval [f(1)−2024×100,f(1)+2024×100][f(1)-2024 \times 100, f(1)+2024 \times 100] contains only 404801<2100404801 < 2^{100} integers. Thus, there must be two distinct xx with the same image, contradicting injectivity! Therefore, pp is a bad prime.

Hence, there are infinitely many bad primes.

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