Maths Olympiad Prep

Library / /134 of 155

Number theory Difficulty 7.0 National olympiad Prove it Saudi Arabia

1) Prove that there are infinitely many positive integers nn such that there exists a permutation of 1,2,3,,n1,2,3, \ldots, n with the property that the difference between any two adjacent numbers is equal to either 20152015 or 20162016.

2) Let kk be a positive integer. Is the statement in 1) still true if we replace the numbers 20152015 and 20162016 by kk and k+2016k+2016, respectively?

Solution

1) First, replace 20152015 and 20162016 by 33 and 44 respectively for convenience. We consider the permutation of {1,2,3,,7}\{1,2,3, \ldots, 7\} as follows:
1,5,2,6,3,7,4. 1,5,2,6,3,7,4.
The numbers increase by 44 and decrease by 33, then the sequence covers all numbers from 11 to 77. Add 11 to each term of the above sequence, we get
8,12,9,13,10,14,11. 8,12,9,13,10,14,11.
Combine two sequences, we have
1,5,2,6,3,7,4,8,12,9,13,10,14,11. 1,5,2,6,3,7,4,8,12,9,13,10,14,11.
This is another permutation of {1,2,3,,14}\{1,2,3, \ldots, 14\}. By this method, we can construct the desired permutation for each number of the form 7k7k, kZk \in \mathbb{Z}, satisfying the condition.

In the same way with the two given numbers 20152015 and 20162016:
1,1+2016,1+20162015, 1,1+2016,1+2016-2015, \ldots
Increase by 20162016 then decrease by 20152015 and so on, we can get the desired permutation for each number of the form (2015+2016)k(2015+2016)k, kZk \in \mathbb{Z}.

2) Now it is easy to see that all numbers kk such that gcd(k,2016)>1\gcd(k, 2016)>1 do not satisfy the given condition. Indeed,

Suppose that gcd(k,2016)=d>1\gcd(k, 2016)=d>1 and there exists a number nn such that the permutation of {1,2,3,,n}\{1,2,3, \ldots, n\} satisfies the given condition. Then all numbers in this sequence have the same remainder when divided by dd, which is a contradiction.

Now we will show that every number coprime with 20162016 will satisfy the given condition by proving the general statement:

If m,km, k are two positive numbers and gcd(m,k)=1\gcd(m, k)=1, then there are infinitely many numbers nn such that there exists a permutation with the property that the difference between any two adjacent numbers is equal to either mm or kk.

Suppose that m>km>k and m=ak+bm=ak+b, 0bk10 \leq b \leq k-1. We will prove that each number nn which is a multiple of t(m+k)=(a+1)k+bt(m+k)=(a+1)k+b satisfies the given condition. Indeed,

Partition the set {1,2,3,,n}\{1,2,3, \ldots, n\} into kk sets and each set contains the numbers sharing the same remainder when divided by kk. And each of them will be arranged decreasing from the largest to the smallest (except the set containing number 11).
11+(ak+b)1+(a1)k+b1+b1+ak+2b1+(a1)k+2b1+2b1+ak+(k1)b1+(a1)k+(k1)b1+(k1)b \begin{aligned} & 1 \rightarrow 1+(ak+b) \rightarrow 1+(a-1)k+b \rightarrow \ldots \rightarrow 1+b \rightarrow \ldots \\ & 1+ak+2b \rightarrow 1+(a-1)k+2b \rightarrow \ldots \rightarrow 1+2b \rightarrow \ldots \\ & \ldots \\ & 1+ak+(k-1)b \rightarrow 1+(a-1)k+(k-1)b \rightarrow \ldots \rightarrow 1+(k-1)b \rightarrow \ldots \end{aligned}
It is easy to see that the difference between two adjacent numbers in each sequence is kk and two sequences can be connected by adding the smallest number in one set to the biggest number in another set. Notice that when we take a number i{2,3,4,,k}i \in \{2,3,4, \ldots, k\} and add mm, we get i+mi+m which has the remainder differing from ii when divided by kk and since gcd(m,k)=1\gcd(m, k)=1 then the set
{i,i+m,i+2m,,i+(k1)m} \{i, i+m, i+2m, \ldots, i+(k-1)m\}
forms a complete system of residues modulo kk, then when we connect all sets we get the permutation of {1,2,3,,n}\{1,2,3, \ldots, n\}. \square

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 and solution reproduced as published; topic and difficulty added by this site.