2024 NZMO Round 2 · Question 4
Solutions (answers with justifications) are required for all problems, including those which ask for an answer.
Determine all positive integers less than such that for all positive integers , the greatest common divisor of and is .
Show answer and methods 2 methods
Answer
The admissible values are .
Method 1 Test the prime divisors of the difference
First exclude : taking gives two copies of . For , every common divisor of and divides . It also cannot be a multiple of , because . Thus every with for an integer works.
Conversely, if has a prime factor , then has a multiplicative inverse modulo . Choose a positive with . Then , and since , also . This fails.
The positive candidates below are and . The next plus choice exceeds the limit, and .
Adapted from the solution by Ross Atkins · Published solution (external)
Method 2 Construct the largest possible gcd
Exclude as already fails. Write with . Since and , the Euclidean algorithm gives . Every possible gcd thus divides .
If , Euler’s theorem modulo gives , because . The choice is a positive integer with . It realizes the largest possible gcd, namely . When , the gcd identity already gives for every .
Thus the condition is precisely , or . Taking gives the nine values in the answer.