Problem 5
Given a permutation of the sequence . A transposition of with is called legal if for , and . The permutation is called regular if after a number of legal transpositions it becomes . For which numbers is the permutation regular?
Step 1 of 5: Analyze the deterministic rule and check small values
In plain words
There are no choices to make: the game plays itself deterministically until lands right behind and halts.
Detailed analysis
Whenever with , a legal transposition looks at the entry immediately before and swaps with . Thus at most one legal transposition is available at any moment, and none is possible if and only if is preceded by (or , which never happens since stays at or ). For and , the initial permutations and are already equal to , so both and are regular.