DR.WANG Mathematics中文

2025 NZMO Round 2 · Question 4

Solutions (answers with justifications) are required for all problems, including those which ask for an answer.

The function rn(x)r_n(x) is the remainder when xx is divided by nn, where 0≤rn(x)<n0\le r_n(x)<n. For which nn does there exist 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 11 to n−1n-1 in some order.)

Show answer and methods 2 methods

Answer

For a nonempty ordering, n=2n=2 is the only modulus. If an empty ordering is admitted, n=1n=1 also works vacuously.

Method 1 Restrict to multiples of one divisor

Write ri=rn(iai)r_i=r_n(ia_i). For any divisor dd of nn, if d∣id\mid i then d∣rid\mid r_i. The two lists (i)(i) and (ri)(r_i) contain the same numbers, hence the same number of multiples of dd. Therefore d∣rid\mid r_i holds exactly at the indices divisible by dd. The same counting argument with (ai)(a_i) shows d∣i  ⟺  d∣ai  ⟺  d∣rid\mid i\iff d\mid a_i\iff d\mid r_i.

Fix any prime p∣np\mid n and put d=n/pd=n/p. At the p−1p-1 indices i=dji=dj, write adj=dbja_{dj}=db_j and rdj=dcjr_{dj}=dc_j. Both (bj)(b_j) and (cj)(c_j) are permutations of 1,…,p−11,\ldots,p-1. Dividing the congruence modulo dpdp by dd gives cj≡djbj(modp)c_j\equiv d j b_j\pmod p. If p∣dp\mid d then every cjc_j is zero modulo pp, which is impossible. Thus p2∤np^2\nmid n.

Let P=(p−1)!P=(p-1)!. Multiplication over all jj gives P≡dp−1P2≡P2(modp)P\equiv d^{p-1}P^2\equiv P^2\pmod p, by Fermat’s little theorem. As PP is invertible, P≡1P\equiv1. If pp is odd, pair nonzero residues with their inverses: only 11 and −1-1 are self-inverse, so P≡−1P\equiv-1, a contradiction.

Every prime divisor of nn is therefore 22, and 222^2 cannot divide nn. For n≥2n\ge2 this forces n=2n=2, and a1=1a_1=1 works. At n=1n=1 both lists are empty if that convention is used.

Method 2 Exclude odd moduli, then halve an even modulus

For each prime p∣np\mid n, exactly n/p−1n/p-1 indices are multiples of pp. All their products have remainders divisible by pp, exhausting the available multiples of pp. Since (ai)(a_i) also has exactly that many multiples of pp, we have p∣aip\mid a_i and p∣rn(iai)p\mid r_n(ia_i) exactly when p∣ip\mid i.

Suppose n>1n>1 is odd and choose p∣np\mid n. Among the indices not divisible by pp, each nonzero residue modulo pp occurs n/pn/p times; the corresponding aia_i and product remainders have this same distribution. The product of each of the three lists is therefore ((p−1)!)n/p≡−1(modp)((p-1)!)^{n/p}\equiv-1\pmod p by Wilson’s theorem, since n/pn/p is odd. But termwise the third list is the product of the first two modulo pp, and (−1)2=1(-1)^2=1. This rules out every odd n>1n>1.

If 4∣n4\mid n, then at even indices aia_i is even, so the product and its remainder are divisible by 44. At odd indices the remainder is odd. The target remainder 22 cannot appear.

The remaining even moduli have the form n=2mn=2m with mm odd. For m>1m>1 the even-indexed terms give a2j=2bja_{2j}=2b_j, rn(2ja2j)=2cjr_n(2j a_{2j})=2c_j, where both (bj)(b_j) and (cj)(c_j) permute 1,…,m−11,\ldots,m-1. Thus cj≡2jbj(modm)c_j\equiv2j b_j\pmod m. Since 22 is invertible modulo mm, the residues jbjj b_j again run through all nonzero residues modulo mm. This would solve the already excluded odd case m>1m>1. Hence m=1m=1, and n=2n=2 indeed works.

Adapted from the solution by James Xu · Published solution (external)