Maths Olympiad Prep

Library / /140 of 299

Number theory Difficulty 6.4 National Olympiad Prove it Iran

Permutation (a1,a2,,an)(a_1, a_2, \dots, a_n) of the set {1,2,,n}\{1, 2, \dots, n\} is called messy if for any three indices 1i<j<kn1 \le i < j < k \le n, ai+ak2aja_i + a_k - 2a_j is not divisible by nn. Find all natural numbers n3n \ge 3 for which there exists a messy permutation of the set {1,2,,n}\{1, 2, \dots, n\}.

Solution

We claim that there exists a messy permutation of {1,2,,n}\{1, 2, \dots, n\} if and only if nn is a power of 22.

First suppose that there is some messy permutation (a1,a2,,an)(a_1, a_2, \dots, a_n) of {1,2,,n}\{1, 2, \dots, n\}. There must be some jj such that aj2a2a1(modn)a_j \equiv 2a_2 - a_1 \pmod{n}. If j3j \ge 3, then naj+a12a2n \mid a_j + a_1 - 2a_2, which contradicts because we have assumed that the permutation is messy. If j=2j = 2, then a2a1(modn)a_2 \equiv a_1 \pmod{n} which is not possible. So j=1j = 1 and 2a22a1(modn)2a_2 \equiv 2a_1 \pmod{n}. Now if nn is odd, we get a2a1(modn)a_2 \equiv a_1 \pmod{n}, which is again impossible. Therefore, we get there is no messy permutation for odd values of nn.

On the other hand, suppose that (a1,a2,,an)(a_1, a_2, \dots, a_n) is a messy permutation and dd is a divisor of nn. Set m=ndm = \frac{n}{d}. We remove the numbers in the permutation which are not divisible by mm to get (ai1,ai2,,aid)(a_{i_1}, a_{i_2}, \dots, a_{i_d}) where maijm \mid a_{i_j} for each jj. Now (ai1m,ai2m,,aidm)(\frac{a_{i_1}}{m}, \frac{a_{i_2}}{m}, \dots, \frac{a_{i_d}}{m}) is a permutation of {1,2,,d}\{1, 2, \dots, d\} modulo dd. We claim that this permutation is messy. Assume to the contrary, there are p<q<rp < q < r among iki_k's such that dapm+arm2aqmd \mid \frac{a_p}{m} + \frac{a_r}{m} - 2\frac{a_q}{m}. This implies n=dmap+ar2aqn = dm \mid a_p + a_r - 2a_q, which is impossible because the first permutation was assumed to be messy.

Therefore, if there is a messy permutation for some integer nn, nn is not divisible by an odd number other than 11 and so nn must be a power of 22.

Finally, we construct a messy permutation of {1,2,,2t}\{1, 2, \dots, 2^t\} by induction on tt. Obviously, {1,3,2,4}\{1, 3, 2, 4\} is a messy permutation for t=2t = 2. Suppose that (a1,a2,,a2t)(a_1, a_2, \dots, a_{2^t}) is a messy permutation for n=2tn = 2^t. Now consider the sequence
(b1,,b2t+1)=(2a1+1,,2a2t+1,2a1,,2a2t) (b_1, \dots, b_{2^{t+1}}) = (2a_1 + 1, \dots, 2a_{2^t} + 1, 2a_1, \dots, 2a_{2^t})
This sequence is a permutation for n=2t+1n = 2^{t+1}. We claim this permutation is messy. If 2t+1bi+bk2bj2^{t+1} \mid b_i + b_k - 2b_j for some i<j<ki < j < k, then k2t+1k \ge 2^t + 1 and i2ti \le 2^t because (a1,a2,,a2t)(a_1, a_2, \dots, a_{2^t}) was assumed to be messy. Now bi+bk2bjb_i + b_k - 2b_j is an odd number and so cannot be divisible by 2t+12^{t+1}. This contradiction shows that (b1,,b2t+1)(b_1, \dots, b_{2^{t+1}}) is a messy permutation and so the proof is complete.

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.