DR.WANG Mathematics中文

BMO2 · 2022/23 · 2023-01-25 · Question 2

Counting & combinatorics · divisibility

Problem outline

Start with the ordered list 1,2,…,n1,2,\ldots,n, where n>1n>1. Two moves are allowed: rotate three consecutive entries (x,y,z)(x,y,z) to (y,z,x)(y,z,x) when 3∣x+y+z3\mid x+y+z, or interchange two consecutive entries (x,y)(x,y) when 3∣x−y3\mid x-y. Determine exactly when the list can be transformed into n,1,2,…,n−1n,1,2,\ldots,n-1.

Show answer and methods 1 methods

Answer

Exactly the integers n≡0n\equiv0 or 1(mod3)1\pmod3.

Method 1 Construct by induction and obstruct the remaining residue class

For n=3n=3, apply the three-entry rotation twice to obtain (3,1,2)(3,1,2). For n=4n=4, rotate the last triple twice to obtain (1,4,2,3)(1,4,2,3), then interchange 11 and 44, whose difference is divisible by 33.

Suppose n≥5n\ge5, n≡0n\equiv0 or 1(mod3)1\pmod3, and the claim is known for n−3n-3. Rotate the final triple (n−2,n−1,n)(n-2,n-1,n) twice, moving nn to the first place within that triple. Then interchange the adjacent entries n−3,nn-3,n. The list now begins 1,2,…,n−4,n1,2,\ldots,n-4,n and ends n−3,n−2,n−1n-3,n-2,n-1.

The rules depend only on residues modulo 33, and n≡n−3(mod3)n\equiv n-3\pmod3. Relabel the last entry of the displayed prefix as n−3n-3 and apply the induction hypothesis to its first n−3n-3 positions. This moves nn to the front and yields the desired list. Hence every n≡0,1(mod3)n\equiv0,1\pmod3 works.

For necessity, if the entries a1,…,ana_1,\ldots,a_n occupy positions 1,…,n1,\ldots,n, put T=∑i=1niaiT=\sum_{i=1}^n i a_i modulo 33. Interchanging adjacent x,yx,y changes TT by x−yx-y, and rotating an allowed triple changes it by 2x−y−z≡−(x+y+z)(mod3)2x-y-z\equiv-(x+y+z)\pmod3. Thus both permitted moves preserve TT.

Moving from (1,2,…,n)(1,2,\ldots,n) to (n,1,…,n−1)(n,1,\ldots,n-1) changes TT by −n(n−1)/2-n(n-1)/2. If n≡2(mod3)n\equiv2\pmod3, this is non-zero modulo 33, contradicting invariance. Therefore no such nn works, completing the classification.

Source and attribution

The outline and worked methods on this page were prepared for DR.WANG Mathematics.

Original question (external)