DR.WANG Mathematics中文

2025 NZMO Round 2 · Question 1

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

Find all pairs of positive integers mm and nn such that the centres of the unit squares in an mm by nn grid of unit squares can be paired up so that the distance between the centres of each pair is exactly 22. (A unit square has side length 11.)

Show answer and methods 2 methods

Answer

Exactly the pairs (m,n)(m,n) for which 4∣m4\mid m or 4∣n4\mid n.

Method 1 Pair within four parity classes

Number the rows and columns starting at 11. A displacement of length 22 satisfies u2+v2=4u^2+v^2=4 with integer u,vu,v. Its only possibilities are (±2,0)(\pm2,0) and (0,±2)(0,\pm2). Thus a pair must have the same row parity and the same column parity.

The numbers of odd and even row indices are ⌈m/2⌉\lceil m/2\rceil and ⌊m/2⌋\lfloor m/2\rfloor. Both counts are even exactly when 4∣m4\mid m: for m=4k,4k+1,4k+2,4k+3m=4k,4k+1,4k+2,4k+3, the pairs of counts are (2k,2k)(2k,2k), (2k+1,2k)(2k+1,2k), (2k+1,2k+1)(2k+1,2k+1) and (2k+2,2k+1)(2k+2,2k+1). The same observation applies to the columns.

If neither dimension is divisible by 44, choose a row parity with an odd count and a column parity with an odd count. The corresponding class has odd size. Its centres can only be paired within that class, which is impossible.

Conversely, if 4∣m4\mid m, split each column into blocks of four consecutive centres. In each block pair the first with the third and the second with the fourth. This uses every centre exactly once. If 4∣n4\mid n, apply the construction along rows.

Adapted from the solution by Tony Wang · Published solution (external)

Method 2 Give each centre a fourth-root weight

Index the rows by r=0,…,m−1r=0,\ldots,m-1 and the columns by c=0,…,n−1c=0,\ldots,n-1. Give centre (r,c)(r,c) the weight ir+ci^{r+c}, where i2=−1i^2=-1. A legal move changes one coordinate by ±2\pm2 and leaves the other fixed, so it negates the weight.

If a complete pairing exists, weights cancel pair by pair. The sum of all weights therefore vanishes. It also factors as 0=∑r=0m−1∑c=0n−1ir+c=1−im1−i 1−in1−i.0=\sum_{r=0}^{m-1}\sum_{c=0}^{n-1} i^{r+c}=\frac{1-i^m}{1-i}\,\frac{1-i^n}{1-i}. A geometric sum vanishes precisely when its length is divisible by 44. Thus 4∣m4\mid m or 4∣n4\mid n.

This necessary condition is sufficient. Along whichever dimension has length divisible by 44, divide every line of centres into blocks of four and pair positions (1,3)(1,3) and (2,4)(2,4) within each block.