For the sake of clarity, we consider and prove the following generalisation of the original problem (which is the case N=1012):
Let N be a positive integer and a1,a2,…,a2N−1 be positive integers such that
- a1,a2,…,a2N−1 is a permutation of 1,2,…,2N−1, and
- ∣a1−a2∣,∣a2−a3∣,…,∣a2N−2−a2N−1∣ is a permutation of 1,2,…,2N−2.
Then a1+a2N−1⩾N+1 and hence max(a1,a2N−1)⩾⌈2N+1⌉.
Now we proceed to the proof of the generalised statement. We introduce the notion of score of a number a∈{1,2,…,2N−1}. The score of a is defined to be
s(a):=∣a−N∣.
Note that, by the triangle inequality,
∣a−b∣⩽∣a−N∣+∣N−b∣=s(a)+s(b)
Considering the sum ∣a1−a2∣+∣a2−a3∣+⋯+∣a2N−2−a2N−1∣, we find that
(N−1)(2N−1)=∣a1−a2∣+∣a2−a3∣+⋯+∣a2N−2−a2N−1∣⩽2(s(a1)+s(a2)+⋯+s(a2N−1))−(s(a1)+s(a2N−1))=2N(N−1)−(s(a1)+s(a2N−1))
For the last equality we used that the numbers s(a1),s(a2),…,s(a2N−1) are a permutation of 0,1,1,2,2,…,N−1,N−1.
Hence, s(a1)+s(a2N−1)⩽2N(N−1)−(N−1)(2N−1)=N−1. We conclude that
(N−a1)+(N−a2N−1)⩽s(a1)+s(a2N−1)⩽N−1,
which implies a1+a2N−1⩾N+1.