Maths Olympiad Prep

Library / IMO Shortlist /315 of 365

IMO Shortlist, 2011

Number theory Difficulty 9.0 Shortlist Prove it IMO

Let kk be a positive integer and set n=2k+1n=2^{k}+1. Prove that nn is a prime number if and only if the following holds: there is a permutation a1,…,an−1a_{1}, \ldots, a_{n-1} of the numbers 1,2,…,n−11,2, \ldots, n-1 and a sequence of integers g1,g2,…,gn−1g_{1}, g_{2}, \ldots, g_{n-1} such that nn divides giai−ai+1g_{i}^{a_{i}}-a_{i+1} for every i∈{1,2,…,n−1}i \in\{1,2, \ldots, n-1\}, where we set an=a1a_{n}=a_{1}.

Solution

Let N={1,2,…,n−1}N=\{1,2, \ldots, n-1\}. For a,b∈Na, b \in N, we say that bb follows aa if there exists an integer gg such that b≡ga( mod n)b \equiv g^{a} (\bmod n) and denote this property as a→ba \rightarrow b. This way we have a directed graph with NN as set of vertices. If a1,…,an−1a_{1}, \ldots, a_{n-1} is a permutation of 1,2,…,n−11,2, \ldots, n-1 such that a1→a2→…→an−1→a1a_{1} \rightarrow a_{2} \rightarrow \ldots \rightarrow a_{n-1} \rightarrow a_{1} then this is a Hamiltonian cycle in the graph.

Step I. First consider the case when nn is composite. Let n=p1α1…psαsn=p_{1}^{\alpha_{1}} \ldots p_{s}^{\alpha_{s}} be its prime factorization. All primes pip_{i} are odd.

Suppose that αi>1\alpha_{i}>1 for some ii. For all integers a,ga, g with a≥2a \geq 2, we have ga≢pi( mod pi2)g^{a} \not \equiv p_{i} \left(\bmod p_{i}^{2}\right), because gag^{a} is either divisible by pi2p_{i}^{2} or it is not divisible by pip_{i}. It follows that in any Hamiltonian cycle pip_{i} comes immediately after 11. The same argument shows that 2pi2 p_{i} also should come immediately after 11, which is impossible. Hence, there is no Hamiltonian cycle in the graph.

Now suppose that nn is square-free. We have n=p1p2…ps>9n=p_{1} p_{2} \ldots p_{s}>9 and s≥2s \geq 2. Assume that there exists a Hamiltonian cycle. There are n−12\frac{n-1}{2} even numbers in this cycle, and each number which follows one of them should be a quadratic residue modulo nn. So, there should be at least n−12\frac{n-1}{2} nonzero quadratic residues modulo nn. On the other hand, for each pip_{i} there exist exactly pi+12\frac{p_{i}+1}{2} quadratic residues modulo pip_{i}; by the Chinese Remainder Theorem, the number of quadratic residues modulo nn is exactly p1+12⋅p2+12⋅…⋅ps+12\frac{p_{1}+1}{2} \cdot \frac{p_{2}+1}{2} \cdot \ldots \cdot \frac{p_{s}+1}{2}, including 00. Then we have a contradiction by
p1+12⋅p2+12⋅…⋅ps+12≤2p13⋅2p23⋅…⋅2ps3=(23)sn≤4n9<n−12. \frac{p_{1}+1}{2} \cdot \frac{p_{2}+1}{2} \cdot \ldots \cdot \frac{p_{s}+1}{2} \leq \frac{2 p_{1}}{3} \cdot \frac{2 p_{2}}{3} \cdot \ldots \cdot \frac{2 p_{s}}{3}=\left(\frac{2}{3}\right)^{s} n \leq \frac{4 n}{9}<\frac{n-1}{2} .
This proves the "if"-part of the problem.

Step II. Now suppose that nn is prime. For any a∈Na \in N, denote by ν2(a)\nu_{2}(a) the exponent of 22 in the prime factorization of aa, and let μ(a)=max⁡{t∈[0,k]∣2t→a}\mu(a)=\max \left\{t \in[0, k] \mid 2^{t} \rightarrow a\right\}.

Lemma. For any a,b∈Na, b \in N, we have a→ba \rightarrow b if and only if ν2(a)≤μ(b)\nu_{2}(a) \leq \mu(b).

Proof. Let ℓ=ν2(a)\ell=\nu_{2}(a) and m=μ(b)m=\mu(b).

Suppose ℓ≤m\ell \leq m. Since bb follows 2m2^{m}, there exists some g0g_{0} such that b≡g02m( mod n)b \equiv g_{0}^{2^{m}} (\bmod n). By gcd⁡(a,n−1)=2ℓ\operatorname{gcd}(a, n-1)=2^{\ell} there exist some integers pp and qq such that pa−q(n−1)=2ℓp a-q(n-1)=2^{\ell}. Choosing g=g02m−ℓpg=g_{0}^{2^{m-\ell} p} we have ga=g02m−ℓpa=g02m+2m−ℓq(n−1)≡g02m≡b( mod n)g^{a}=g_{0}^{2^{m-\ell} p a}=g_{0}^{2^{m}+2^{m-\ell} q(n-1)} \equiv g_{0}^{2^{m}} \equiv b (\bmod n) by Fermat's theorem. Hence, a→ba \rightarrow b.

To prove the reverse statement, suppose that a→ba \rightarrow b, so b≡ga( mod n)b \equiv g^{a} (\bmod n) with some gg. Then b≡(ga/2ℓ)2ℓb \equiv\left(g^{a / 2^{\ell}}\right)^{2^{\ell}}, and therefore 2ℓ→b2^{\ell} \rightarrow b. By the definition of μ(b)\mu(b), we have μ(b)≥ℓ\mu(b) \geq \ell. The lemma is proved.

Now for every ii with 0≤i≤k0 \leq i \leq k, let
Ai={a∈N∣ν2(a)=i},Bi={a∈N∣μ(a)=i},and Ci={a∈N∣μ(a)≥i}=Bi∪Bi+1∪…∪Bk. \begin{aligned} A_{i} & =\left\{a \in N \mid \nu_{2}(a)=i\right\}, \\ B_{i} & =\{a \in N \mid \mu(a)=i\}, \\ \text{and } C_{i} & =\{a \in N \mid \mu(a) \geq i\}=B_{i} \cup B_{i+1} \cup \ldots \cup B_{k} . \end{aligned}
We claim that ∣Ai∣=∣Bi∣\left|A_{i}\right|=\left|B_{i}\right| for all 0≤i≤k0 \leq i \leq k. Obviously we have ∣Ai∣=2k−i−1\left|A_{i}\right|=2^{k-i-1} for all i=0,…,k−1i= 0, \ldots, k-1, and ∣Ak∣=1\left|A_{k}\right|=1. Now we determine ∣Ci∣\left|C_{i}\right|. We have ∣C0∣=n−1\left|C_{0}\right|=n-1 and by Fermat's theorem we also have Ck={1}C_{k}=\{1\}, so ∣Ck∣=1\left|C_{k}\right|=1. Next, notice that Ci+1={x2 mod n∣x∈Ci}C_{i+1}=\left\{x^{2} \bmod n \mid x \in C_{i}\right\}. For every a∈Na \in N, the relation x2≡a( mod n)x^{2} \equiv a (\bmod n) has at most two solutions in NN. Therefore we have 2∣Ci+1∣≤∣Ci∣2\left|C_{i+1}\right| \leq\left|C_{i}\right|, with the equality achieved only if for every y∈Ci+1y \in C_{i+1}, there exist distinct elements x,x′∈Cix, x' \in C_{i} such that x2≡x′2≡y( mod n)x^{2} \equiv x'^{2} \equiv y (\bmod n) (this implies x+x′=nx+x'=n). Now, since 2k∣Ck∣=∣C0∣2^{k}\left|C_{k}\right|=\left|C_{0}\right|, we obtain that this equality should be achieved in each step. Hence ∣Ci∣=2k−i\left|C_{i}\right|=2^{k-i} for 0≤i≤k0 \leq i \leq k, and therefore ∣Bi∣=2k−i−1\left|B_{i}\right|=2^{k-i-1} for 0≤i≤k−10 \leq i \leq k-1 and ∣Bk∣=1\left|B_{k}\right|=1.

From the previous arguments we can see that for each z∈Ci(0≤i<k)z \in C_{i} (0 \leq i<k) the equation x2≡z2( mod n)x^{2} \equiv z^{2} (\bmod n) has two solutions in CiC_{i}, so we have n−z∈Cin-z \in C_{i}. Hence, for each i=0,1,…,k−1i=0,1, \ldots, k-1, exactly half of the elements of CiC_{i} are odd. The same statement is valid for Bi=Ci\Ci+1B_{i}=C_{i} \backslash C_{i+1} for 0≤i≤k−20 \leq i \leq k-2. In particular, each such BiB_{i} contains an odd number. Note that Bk={1}B_{k}=\{1\} also contains an odd number, and Bk−1={2k}B_{k-1}=\left\{2^{k}\right\} since Ck−1C_{k-1} consists of the two square roots of 11 modulo nn.

Step III. Now we construct a Hamiltonian cycle in the graph. First, for each ii with 0≤i≤k0 \leq i \leq k, connect the elements of AiA_{i} to the elements of BiB_{i} by means of an arbitrary bijection. After performing this for every ii, we obtain a subgraph with all vertices having in-degree 11 and outdegree 11, so the subgraph is a disjoint union of cycles. If there is a unique cycle, we are done. Otherwise, we modify the subgraph in such a way that the previous property is preserved and the number of cycles decreases; after a finite number of steps we arrive at a single cycle.

For every cycle CC, let λ(C)=min⁡c∈Cν2(c)\lambda(C)=\min _{c \in C} \nu_{2}(c). Consider a cycle CC for which λ(C)\lambda(C) is maximal. If λ(C)=0\lambda(C)=0, then for any other cycle C′C' we have λ(C′)=0\lambda\left(C'\right)=0. Take two arbitrary vertices a∈Ca \in C and a′∈C′a' \in C' such that ν2(a)=ν2(a′)=0\nu_{2}(a)=\nu_{2}\left(a'\right)=0; let their direct successors be bb and b′b', respectively. Then we can unify CC and C′C' to a single cycle by replacing the edges a→ba \rightarrow b and a′→b′a' \rightarrow b' by a→b′a \rightarrow b' and a′→ba' \rightarrow b.

Now suppose that λ=λ(C)≥1\lambda=\lambda(C) \geq 1; let a∈C∩Aλa \in C \cap A_{\lambda}. If there exists some a′∈Aλ\Ca' \in A_{\lambda} \backslash C, then a′a' lies in another cycle C′C' and we can merge the two cycles in exactly the same way as above. So, the only remaining case is Aλ⊂CA_{\lambda} \subset C. Since the edges from AλA_{\lambda} lead to BλB_{\lambda}, we get also Bλ⊂CB_{\lambda} \subset C. If λ≠k−1\lambda \neq k-1 then BλB_{\lambda} contains an odd number; this contradicts the assumption λ(C)>0\lambda(C)>0. Finally, if λ=k−1\lambda=k-1, then CC contains 2k−12^{k-1} which is the only element of Ak−1A_{k-1}. Since Bk−1={2k}=AkB_{k-1}=\left\{2^{k}\right\}=A_{k} and Bk={1}B_{k}=\{1\}, the cycle CC contains the path 2k−1→2k→12^{k-1} \rightarrow 2^{k} \rightarrow 1 and it contains an odd number again. This completes the proof of the "only if"-part of the problem.

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

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