Maths Olympiad Prep

Library / NZMO Round Two /14 of 17

NZMO Round Two

Number theory Difficulty 6.6 National Olympiad Prove it New Zealand

Problem:
The function rn(x)r_{n}(x) is the remainder when xx is divided by nn, where 0≤rn(x)<n0 \leq r_{n}(x) < n. For which nn does there exists some ordering {a1,…,an−1}\{a_{1}, \ldots , a_{n - 1}\} of {1,2,…,n−1}\{1, 2, \ldots , n - 1\} such that {rn(a1),rn(2×a2),…,rn((n−1)×an−1)}\{r_{n}(a_{1}), r_{n}(2 \times a_{2}), \ldots , r_{n}((n - 1) \times a_{n - 1})\} is an ordering of {1,2,…,n−1}\{1, 2, \ldots , n - 1\}?

(An ordering of {1,2,…,n−1}\{1, 2, \ldots , n - 1\} is the sequence of numbers 1 to n−1n - 1 in some order.)

Solution

Solution:
Notice that rn(x)r_{n}(x) is just xx modulo nn. Therefore
∏irn(iai)≡∏iiai(modn) \prod_{i} r_{n}(i a_{i}) \equiv \prod_{i} i a_{i} \pmod{n}
For primes pp, apply Wilson's theorem to see that we must have
∏iiai≡−1(modp) \prod_{i} i a_{i} \equiv -1 \pmod{p}
However,
∏iiai=∏ii∏iai≡(−1)2≡1(modp) \prod_{i} i a_{i} = \prod_{i} i \prod_{i} a_{i} \equiv (-1)^{2} \equiv 1 \pmod{p}
So the only possibility in that case is p=2p = 2.

Now, if nn is composite, then let nn be the minimal solution. Let n=pqn = pq for prime pp. Notice that we must have (p−1)q(p - 1)q numbers in {a1,2a2,3a3,…,(n−1)an−1}\{a_{1}, 2a_{2}, 3a_{3}, \ldots , (n - 1)a_{n - 1}\} not divisible by pp. The q−1q - 1 numbers of the form (kp)akp(kp)a_{kp} are divisible by pp and there are only q−1q - 1 multiples of pp in {1,2,…,pq−1}\{1, 2, \ldots , pq - 1\}. Therefore they must be the only numbers divisible by pp, so {akp∣1≤k<q}={kp∣1≤k<q}\{a_{kp} \mid 1 \leq k < q\} = \{kp \mid 1 \leq k < q\}.

Now, p∤qp \nmid q as otherwise all of (kp)akp(kp)a_{kp} are multiples of p2p^{2}, which is not true.

Let c≡1p(modq)c \equiv \frac{1}{p} \pmod{q}. Consider {app,a2pp,…,a(q−1)pp}={1,2,…,q−1}\left\{\frac{a_{p}}{p}, \frac{a_{2p}}{p}, \ldots , \frac{a_{(q - 1)p}}{p}\right\} = \{1, 2, \ldots , q - 1\}.
Then,
{app,2a2pp,…,(q−1)a(q−1)pp}={papp2,2pa2pp2,…,(q−1)pa(q−1)pp2} \left\{\frac{a_{p}}{p}, \frac{2a_{2p}}{p}, \ldots , \frac{(q - 1)a_{(q - 1)p}}{p}\right\} = \left\{\frac{p a_{p}}{p^{2}}, \frac{2p a_{2p}}{p^{2}}, \ldots , \frac{(q - 1)p a_{(q - 1)p}}{p^{2}}\right\}
≡c{1,2,3,…,q−1}(modq) \equiv c\{1,2,3,\ldots ,q - 1\} \pmod{q}
As (kp)akp≡k′p(k p)a_{k p} \equiv k' p (mod pqp q) for some k′k', and kakp≡k′k a_{k p} \equiv k' (mod qq)
Since gcd⁡(c,q)=1\gcd(c,q) = 1
c{1,2,3,…,q−1}≡{1,2,3,…,q−1}(modq) c\{1,2,3,\ldots ,q - 1\} \equiv \{1,2,3,\ldots ,q - 1\} \pmod{q}
in some order. This is a solution for n=qn = q, which contradicts the minimality of the solution for n=pqn = p q. Therefore no such solution n=pqn = p q can exist.

Hence, n=2n = 2 is the only solution.

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.