Maths Olympiad Prep

Library / /15 of 19

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 0rn(x)<n0 \leq r_{n}(x) < n. For which nn does there exists some ordering {a1,,an1}\{a_{1}, \ldots , a_{n - 1}\} of {1,2,,n1}\{1, 2, \ldots , n - 1\} such that {rn(a1),rn(2×a2),,rn((n1)×an1)}\{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,,n1}\{1, 2, \ldots , n - 1\}?

(An ordering of {1,2,,n1}\{1, 2, \ldots , n - 1\} is the sequence of numbers 1 to n1n - 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
iiai1(modp) \prod_{i} i a_{i} \equiv -1 \pmod{p}
However,
iiai=iiiai(1)21(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 (p1)q(p - 1)q numbers in {a1,2a2,3a3,,(n1)an1}\{a_{1}, 2a_{2}, 3a_{3}, \ldots , (n - 1)a_{n - 1}\} not divisible by pp. The q1q - 1 numbers of the form (kp)akp(kp)a_{kp} are divisible by pp and there are only q1q - 1 multiples of pp in {1,2,,pq1}\{1, 2, \ldots , pq - 1\}. Therefore they must be the only numbers divisible by pp, so {akp1k<q}={kp1k<q}\{a_{kp} \mid 1 \leq k < q\} = \{kp \mid 1 \leq k < q\}.

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

Let c1p(modq)c \equiv \frac{1}{p} \pmod{q}. Consider {app,a2pp,,a(q1)pp}={1,2,,q1}\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,,(q1)a(q1)pp}={papp2,2pa2pp2,,(q1)pa(q1)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,,q1}(modq) \equiv c\{1,2,3,\ldots ,q - 1\} \pmod{q}
As (kp)akpkp(k p)a_{k p} \equiv k' p (mod pqp q) for some kk', and kakpkk a_{k p} \equiv k' (mod qq)
Since gcd(c,q)=1\gcd(c,q) = 1
c{1,2,3,,q1}{1,2,3,,q1}(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,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.