Maths Olympiad Prep

Track / Stage 9 / 33 of 52 #2553 of 2604

Problem 2553

IMO P2/P5; hard shortlist
Number theory Difficulty 9.1 Prove it Chinese IMO National Team Selection Test · China · 2023

Given an integer n>1n > 1 and an integer aa that is coprime with nn. There is a country consisting of nn islands D1,D2,…,DnD_1, D_2, \dots, D_n. For any two different islands DiD_i and DjD_j, there is a one-way ferry from DiD_i to DjD_j if and only if ij≡ia(modn)ij \equiv ia \pmod{n}. A tourist hopes to visit as many islands as possible. He can first fly to any island he chooses to start the tour, and afterwards can only use the one-way ferry to tour freely between islands in this country. Find the maximum possible number of different islands that the tourist can visit.

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

Let x(n)=∑vp(n)≥21x(n) = \sum_{v_p(n) \ge 2} 1 and y(n)=∑vp(n)=11y(n) = \sum_{v_p(n)=1} 1. Let the maximum number of islands that can be visited be denoted as k(n)k(n). Then we have:
k(n)={3x(n)+2y(n)+1,v2(n)≠1,3x(n)+2y(n),v2(n)=1. k(n) = \begin{cases} 3x(n) + 2y(n) + 1, & v_2(n) \neq 1, \\ 3x(n) + 2y(n), & v_2(n) = 1. \end{cases}
For x,y∈Zx, y \in \mathbb{Z} and m∈Z>0m \in \mathbb{Z}_{>0}, if xy≡xa(modm)xy \equiv xa \pmod{m}, we denote this as x→y(modm)x \to y \pmod{m}. Let pp be a prime factor of nn and pα∤np^\alpha \nmid n. For a sequence x1→x2→⋯→xk(modn)x_1 \to x_2 \to \dots \to x_k \pmod{n}, the same relation holds modulo pαp^\alpha:
x1→x2→⋯→xk(modpα). x_1 \to x_2 \to \dots \to x_k \pmod{p^\alpha}.
(1) If xi≠0(modpα)x_i \neq 0 \pmod{p^\alpha}, then xi+1x_{i+1} is coprime to pp. This is because pα∣xi(xi+1−a)p^\alpha \mid x_i(x_{i+1} - a), and pα∤xip^\alpha \nmid x_i. Therefore, p∣xi+1−ap \mid x_{i+1} - a. Since aa is coprime to nn, we have p∤ap \nmid a, which implies p∤xi+1p \nmid x_{i+1}.
(2) If xix_i is coprime to pp, then xi+1≡a(modpα)x_{i+1} \equiv a \pmod{p^\alpha}. This is because pα∣xi(xi+1−a)p^\alpha \mid x_i(x_{i+1} - a), and since p∤xip \nmid x_i, we have pα∣xi+1−ap^\alpha \mid x_{i+1} - a.
(3) From (1) and (2), we can conclude that if α≥2\alpha \ge 2, the sequence x1,x2,…,xk(modpα)x_1, x_2, \dots, x_k \pmod{p^\alpha} undergoes at most three changes: it changes from being divisible by pαp^\alpha to being nonzero, then becomes coprime to pp, and finally becomes congruent to aa modulo pαp^\alpha.
If α=1\alpha = 1 and p≠2p \neq 2, then x1,x2,…,xk(modpα)x_1, x_2, \dots, x_k \pmod{p^\alpha} undergo at most two changes: it changes from being congruent to 0 modulo pp to being coprime to pp, and finally becomes congruent to aa modulo pp.
If α=1\alpha = 1 and p=2p = 2, then x1,x2,…,xk(modpα)x_1, x_2, \dots, x_k \pmod{p^\alpha} undergo at most one change: it changes from being congruent to 0 modulo 2 to being congruent to aa modulo 2.
Assuming that x1,x2,…,xk(modn)x_1, x_2, \dots, x_k \pmod{n} have distinct adjacent terms, then adjacent terms have changes in some modulo pαp^\alpha, implying that k≤k(n)k \le k(n).
(4) Construct examples for k=k(n)k = k(n). First, consider the cases based on modulo pαp^\alpha.
(i) If α≥2\alpha \ge 2, we have 0→p→a+pα−1→a(modpα)0 \to p \to a + p^{\alpha-1} \to a \pmod{p^\alpha}.
(ii) If α=1\alpha = 1 and p≠2p \neq 2, we have 0→b→a(modp)0 \to b \to a \pmod{p}, where bb is coprime to pp and b≠a(modp)b \neq a \pmod{p}.
(iii) If α=1\alpha = 1 and p=2p = 2, we have 0→a(mod2)0 \to a \pmod{2}.
Let n=p1α1⋯pwαwn = p_1^{\alpha_1} \cdots p_w^{\alpha_w} be the prime factorization of nn. For each piαip_i^{\alpha_i}, we choose a sequence corresponding to the three cases mentioned above. Note that 0→00 \to 0 and a→aa \to a. We can appropriately add some zeros at the beginning and some aa's at the end of the sequences to ensure that their lengths reach k(n)k(n). Let's denote these modified sequences as LiL_i. It is required that for piαip_i^{\alpha_i} and pjαjp_j^{\alpha_j} (i≠ji \neq j), the positions where changes occur in LiL_i and LjL_j are different.

For example, suppose α1≥2\alpha_1 \ge 2, we can take
L1:0→p1→a+p1α1−1→a→a→⋯→a(modp1α1). L_1: 0 \to p_1 \to a + p_1^{\alpha_1-1} \to a \to a \to \dots \to a \pmod{p_1^{\alpha_1}}.
If α2=1\alpha_2 = 1 and p2≠2p_2 \ne 2, we can also take
L2:0→0→0→0→b→a→a→⋯→a(modp2), L_2: 0 \to 0 \to 0 \to 0 \to b \to a \to a \to \dots \to a \pmod{p_2},
and continue this way to construct L3,…,LwL_3, \dots, L_w.
By using the tt-th term of L1,L2,…,LwL_1, L_2, \dots, L_w and the Chinese Remainder Theorem, we can determine xtx_t. Since xt→xt+1(modpiαi)x_t \to x_{t+1} \pmod{p_i^{\alpha_i}} for 1≤i≤w1 \le i \le w, it follows that xt→xt+1(modn)x_t \to x_{t+1} \pmod{n}. Moreover, the sequence x1,x2,…,xk(n)x_1, x_2, \dots, x_{k(n)} modulo nn has distinct terms. This confirms the conclusion of the original problem, and the maximum value k(n)k(n) is given by the formula mentioned at the beginning of the solution. □\square

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