Maths Olympiad Prep

Library / /332 of 383

, 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,,an1a_{1}, \ldots, a_{n-1} of the numbers 1,2,,n11,2, \ldots, n-1 and a sequence of integers g1,g2,,gn1g_{1}, g_{2}, \ldots, g_{n-1} such that nn divides giaiai+1g_{i}^{a_{i}}-a_{i+1} for every i{1,2,,n1}i \in\{1,2, \ldots, n-1\}, where we set an=a1a_{n}=a_{1}.

Solution

Let N={1,2,,n1}N=\{1,2, \ldots, n-1\}. For a,bNa, b \in N, we say that bb follows aa if there exists an integer gg such that bga(modn)b \equiv g^{a} (\bmod n) and denote this property as aba \rightarrow b. This way we have a directed graph with NN as set of vertices. If a1,,an1a_{1}, \ldots, a_{n-1} is a permutation of 1,2,,n11,2, \ldots, n-1 such that a1a2an1a1a_{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α1psα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 a2a \geq 2, we have ga≢pi(modpi2)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=p1p2ps>9n=p_{1} p_{2} \ldots p_{s}>9 and s2s \geq 2. Assume that there exists a Hamiltonian cycle. There are n12\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 n12\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+12p2+12ps+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+12p2+12ps+122p132p232ps3=(23)sn4n9<n12. \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 aNa \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]2ta}\mu(a)=\max \left\{t \in[0, k] \mid 2^{t} \rightarrow a\right\}.

Lemma. For any a,bNa, b \in N, we have aba \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 bg02m(modn)b \equiv g_{0}^{2^{m}} (\bmod n). By gcd(a,n1)=2\operatorname{gcd}(a, n-1)=2^{\ell} there exist some integers pp and qq such that paq(n1)=2p a-q(n-1)=2^{\ell}. Choosing g=g02mpg=g_{0}^{2^{m-\ell} p} we have ga=g02mpa=g02m+2mq(n1)g02mb(modn)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, aba \rightarrow b.

To prove the reverse statement, suppose that aba \rightarrow b, so bga(modn)b \equiv g^{a} (\bmod n) with some gg. Then b(ga/2)2b \equiv\left(g^{a / 2^{\ell}}\right)^{2^{\ell}}, and therefore 2b2^{\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 0ik0 \leq i \leq k, let
Ai={aNν2(a)=i},Bi={aNμ(a)=i},and Ci={aNμ(a)i}=BiBi+1Bk. \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 0ik0 \leq i \leq k. Obviously we have Ai=2ki1\left|A_{i}\right|=2^{k-i-1} for all i=0,,k1i= 0, \ldots, k-1, and Ak=1\left|A_{k}\right|=1. Now we determine Ci\left|C_{i}\right|. We have C0=n1\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={x2modnxCi}C_{i+1}=\left\{x^{2} \bmod n \mid x \in C_{i}\right\}. For every aNa \in N, the relation x2a(modn)x^{2} \equiv a (\bmod n) has at most two solutions in NN. Therefore we have 2Ci+1Ci2\left|C_{i+1}\right| \leq\left|C_{i}\right|, with the equality achieved only if for every yCi+1y \in C_{i+1}, there exist distinct elements x,xCix, x' \in C_{i} such that x2x2y(modn)x^{2} \equiv x'^{2} \equiv y (\bmod n) (this implies x+x=nx+x'=n). Now, since 2kCk=C02^{k}\left|C_{k}\right|=\left|C_{0}\right|, we obtain that this equality should be achieved in each step. Hence Ci=2ki\left|C_{i}\right|=2^{k-i} for 0ik0 \leq i \leq k, and therefore Bi=2ki1\left|B_{i}\right|=2^{k-i-1} for 0ik10 \leq i \leq k-1 and Bk=1\left|B_{k}\right|=1.

From the previous arguments we can see that for each zCi(0i<k)z \in C_{i} (0 \leq i<k) the equation x2z2(modn)x^{2} \equiv z^{2} (\bmod n) has two solutions in CiC_{i}, so we have nzCin-z \in C_{i}. Hence, for each i=0,1,,k1i=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 0ik20 \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 Bk1={2k}B_{k-1}=\left\{2^{k}\right\} since Ck1C_{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 0ik0 \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)=mincCν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 CC' we have λ(C)=0\lambda\left(C'\right)=0. Take two arbitrary vertices aCa \in C and aCa' \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 bb', respectively. Then we can unify CC and CC' to a single cycle by replacing the edges aba \rightarrow b and aba' \rightarrow b' by aba \rightarrow b' and aba' \rightarrow b.

Now suppose that λ=λ(C)1\lambda=\lambda(C) \geq 1; let aCAλa \in C \cap A_{\lambda}. If there exists some aAλ\Ca' \in A_{\lambda} \backslash C, then aa' lies in another cycle CC' 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 λk1\lambda \neq k-1 then BλB_{\lambda} contains an odd number; this contradicts the assumption λ(C)>0\lambda(C)>0. Finally, if λ=k1\lambda=k-1, then CC contains 2k12^{k-1} which is the only element of Ak1A_{k-1}. Since Bk1={2k}=AkB_{k-1}=\left\{2^{k}\right\}=A_{k} and Bk={1}B_{k}=\{1\}, the cycle CC contains the path 2k12k12^{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,000 problems in a working order, from AMC 10 level to the IMO shortlist.

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