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 3 of 5: Define the block configuration and reach for odd
In plain words
When is odd, the first leftward sweep jumps all the way to , pairing every even number with the odd number above it into sorted blocks of length .
Detailed analysis
For odd , set and , and write for a contiguous ascending block. Let be the initial permutation and define as whenever . In the first pass from , since is odd, swaps successively with , landing at index right after and pairing the remaining entries into , which is exactly .