MathDB
P300. Saudi Arabia IMO TST

Source:

June 30, 2018
SAUmiscellaneous

Problem Statement

Find the number of permutations (a1,a2,. . ,a2016) ( a_1, a_2, . \ . \ , a_{2016}) of the first 2016 2016 positive integers satisfying the following two conditions:
1. ai+1ai1 a_{i+1} - a_i \leq 1 for all i=1,2,. . .,2015i = 1, 2, . \ . \ . , 2015, and 2. There are exactly two indices i<j i < j with 1i<j2016 1 \leq i < j \leq 2016 such that ai=i a_i = i and aj=j a_j = j.