Problem

Source: Bosnia and Herzegovina EGMO Team Selection Test 2017

Tags: Sequence, iterations, combinatorics



It is given sequence wih length of $2017$ which consists of first $2017$ positive integers in arbitrary order (every number occus exactly once). Let us consider a first term from sequence, let it be $k$. From given sequence we form a new sequence of length 2017, such that first $k$ elements of new sequence are same as first $k$ elements of original sequence, but in reverse order while other elements stay unchanged. Prove that if we continue transforming a sequence, eventually we will have sequence with first element $1$.