Olympiad Maths Prep

Track / Stage 8 / 2 of 180 #1702 of 2000

Problem 1702

IMO Shortlist mid-range; USAMO P2/P5
Number theory Difficulty 8.0 Prove it EGMO · European Girls' Mathematical Olympiad (EGMO)

Problem:
For a positive integer NN, let c1<c2<<cmc_{1} < c_{2} < \dots < c_{m} be all the positive integers smaller than NN that are coprime to NN. Find all N3N \geq 3 such that
gcd(N,ci+ci+1)1 gcd (N, c_{i} + c_{i + 1}) \neq 1
for all 1im11 \leq i \leq m - 1.
Here gcd(a,b)\gcd(a, b) is the largest positive integer that divides both aa and bb. Integers aa and bb are coprime if gcd(a,b)=1\gcd(a, b) = 1.

This one wants a proof. Work it on paper, read the official solution, then mark yourself honestly — the ladder only means something if the record is true.

Official solutions — 2

Solution 1

Solution:
The answer is all even integers and all powers of 33. First we show that these work.

- When NN is even, all cic_{i} are odd, and so 2gcd(N,ci+ci+1)2 \mid \gcd (N, c_{i} + c_{i + 1}) for every ii.

- When NN is a power of 33, the cic_{i} are exactly the numbers in the range 1,2,,N11, 2, \ldots, N - 1 that are not divisible by 33. So, the sequence c1,,cmc_{1}, \ldots, c_{m} alternates between numbers congruent to 11 (mod 33) and 22 (mod 33). Thus 3gcd(N,ci+ci+1)3 \mid \gcd (N, c_{i} + c_{i + 1}) for every ii.

Now we show that no other positive integer works. For the sake of contradiction, consider an odd candidate NN that is not a power of 33, and suppose it satisfies the problem condition. Then, since c1=1c_{1} = 1 and c2=2c_{2} = 2, we have gcd(N,1+2)1\gcd (N, 1 + 2) \neq 1, so 3N3 \mid N. Thus, we can write NN as 3kM3^{k} M, where k1k \geq 1 and gcd(M,6)=1\gcd (M, 6) = 1. We have M5M \geq 5 (as M1M \neq 1 by assumption) and M+2<NM + 2 < N.

We now split into two cases based on MM modulo 33.

Case 1. M1M \equiv 1 (mod 33).
As 3M13 \mid M - 1 and MMM \mid M, neither M1M - 1 nor MM are in the sequence {ci}\{c_{i}\}. As MM is odd and M1M \equiv 1 (mod 33), M2M - 2 and M+1M + 1 are congruent to 11 (mod 33), are coprime to MM, and are smaller than NN. Thus, both M2M - 2 and M+1M + 1 are in the sequence, and they are consecutive terms. However, this means gcd(N,2M1)1\gcd (N, 2M - 1) \neq 1. This gives a contradiction, as both 33 and MM are coprime to 2M12M - 1.

Case 2. M2M \equiv 2 (mod 33).
This case is similar to Case 1. Neither MM nor M+1M + 1 are in the sequence, but M1M - 1 and M+2M + 2 are. We obtain a similar contradiction from gcd(N,2M+1)1\gcd (N, 2M + 1) \neq 1.

Solution 2

Solution:
We give an alternative way to show that any odd NN has to be the power of 33. Suppose for contradiction that NN has at least 22 distinct prime factors. Choose integers a,b>1a, b > 1 such that
abNab \mid N
- aa and bb are coprime;
- Every prime divisor of NN divides abab.

We use the Chinese Remainder Theorem, to find an integer n[1,ab]n \in [1, ab] such that
{n1(moda),n2(modb). \left\{ \begin{array}{ll} n \equiv 1 \pmod{a}, \\ n \equiv 2 \pmod{b}. \end{array} \right.
We claim that there is an index ii such that ci=n3c_{i} = n - 3 and ci+1=nc_{i + 1} = n. Indeed, we note the following:

- nn is consecutive to a multiple of aa, so gcd(a,n)=1\gcd(a, n) = 1. In a similar way we get that gcd(b,n3)=1\gcd(b, n - 3) = 1.
- nn is 22 away from a multiple of bb, therefore as 2b2 \nmid b, gcd(b,n)=1\gcd(b, n) = 1. In a similar way we get that gcd(a,n3)=1\gcd(a, n - 3) = 1.
- nabNn \leq ab \leq N and n3(a+1)3>0n - 3 \geq (a + 1) - 3 > 0 as a>2a > 2.

This implies that nn and n3n - 3 are coprime with NN, whereas neither n2n - 2 nor n1n - 1 are coprime with NN, which proves our claim. Finally, we claim that ci+ci+1=(n3)+n=2n3c_{i} + c_{i + 1} = (n - 3) + n = 2n - 3 is coprime with NN. Indeed we have 2n31(moda)2n - 3 \equiv -1 \pmod{a} and 2n31(modb)2n - 3 \equiv 1 \pmod{b}. This implies that NN is a prime power.

When NN is odd, since c1=1c_{1} = 1 and c2=2c_{2} = 2, we have gcd(N,1+2)1\gcd(N, 1 + 2) \neq 1, so 3N3 \mid N, which implies that NN is necessarily a power of 33. This concludes our proof.

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.