Statistics database

Identifier
      
View
Edit
Identifier
St000028 : Permutations $\longrightarrow \mathbb{Z}$
Values
                             [1] => 0
                        

                             [1,2] => 0
                        

                             [2,1] => 1
                        

                             [1,2,3] => 0
                        

                             [1,3,2] => 1
                        

                             [2,1,3] => 1
                        

                             [2,3,1] => 2
                        

                             [3,1,2] => 1
                        

                             [3,2,1] => 1
                        

                             [1,2,3,4] => 0
                        

                             [1,2,4,3] => 1
                        

                             [1,3,2,4] => 1
                        

                             [1,3,4,2] => 2
                        

                             [1,4,2,3] => 1
                        

                             [1,4,3,2] => 1
                        

                             [2,1,3,4] => 1
                        

                             [2,1,4,3] => 1
                        

                             [2,3,1,4] => 2
                        

                             [2,3,4,1] => 3
                        

                             [2,4,1,3] => 2
                        

                             [2,4,3,1] => 2
                        

                             [3,1,2,4] => 1
                        

                             [3,1,4,2] => 2
                        

                             [3,2,1,4] => 1
                        

                             [3,2,4,1] => 3
                        

                             [3,4,1,2] => 2
                        

                             [3,4,2,1] => 2
                        

                             [4,1,2,3] => 1
                        

                             [4,1,3,2] => 1
                        

                             [4,2,1,3] => 1
                        

                             [4,2,3,1] => 2
                        

                             [4,3,1,2] => 1
                        

                             [4,3,2,1] => 1
                        

                             [1,2,3,4,5] => 0
                        

                             [1,2,3,5,4] => 1
                        

                             [1,2,4,3,5] => 1
                        

                             [1,2,4,5,3] => 2
                        

                             [1,2,5,3,4] => 1
                        

                             [1,2,5,4,3] => 1
                        

                             [1,3,2,4,5] => 1
                        

                             [1,3,2,5,4] => 1
                        

                             [1,3,4,2,5] => 2
                        

                             [1,3,4,5,2] => 3
                        

                             [1,3,5,2,4] => 2
                        

                             [1,3,5,4,2] => 2
                        

                             [1,4,2,3,5] => 1
                        

                             [1,4,2,5,3] => 2
                        

                             [1,4,3,2,5] => 1
                        

                             [1,4,3,5,2] => 3
                        

                             [1,4,5,2,3] => 2
                        

                             [1,4,5,3,2] => 2
                        

                             [1,5,2,3,4] => 1
                        

                             [1,5,2,4,3] => 1
                        

                             [1,5,3,2,4] => 1
                        

                             [1,5,3,4,2] => 2
                        

                             [1,5,4,2,3] => 1
                        

                             [1,5,4,3,2] => 1
                        

                             [2,1,3,4,5] => 1
                        

                             [2,1,3,5,4] => 1
                        

                             [2,1,4,3,5] => 1
                        

                             [2,1,4,5,3] => 2
                        

                             [2,1,5,3,4] => 1
                        

                             [2,1,5,4,3] => 1
                        

                             [2,3,1,4,5] => 2
                        

                             [2,3,1,5,4] => 2
                        

                             [2,3,4,1,5] => 3
                        

                             [2,3,4,5,1] => 4
                        

                             [2,3,5,1,4] => 3
                        

                             [2,3,5,4,1] => 3
                        

                             [2,4,1,3,5] => 2
                        

                             [2,4,1,5,3] => 2
                        

                             [2,4,3,1,5] => 2
                        

                             [2,4,3,5,1] => 4
                        

                             [2,4,5,1,3] => 3
                        

                             [2,4,5,3,1] => 3
                        

                             [2,5,1,3,4] => 2
                        

                             [2,5,1,4,3] => 2
                        

                             [2,5,3,1,4] => 2
                        

                             [2,5,3,4,1] => 3
                        

                             [2,5,4,1,3] => 2
                        

                             [2,5,4,3,1] => 2
                        

                             [3,1,2,4,5] => 1
                        

                             [3,1,2,5,4] => 1
                        

                             [3,1,4,2,5] => 2
                        

                             [3,1,4,5,2] => 3
                        

                             [3,1,5,2,4] => 2
                        

                             [3,1,5,4,2] => 2
                        

                             [3,2,1,4,5] => 1
                        

                             [3,2,1,5,4] => 1
                        

                             [3,2,4,1,5] => 3
                        

                             [3,2,4,5,1] => 4
                        

                             [3,2,5,1,4] => 3
                        

                             [3,2,5,4,1] => 3
                        

                             [3,4,1,2,5] => 2
                        

                             [3,4,1,5,2] => 3
                        

                             [3,4,2,1,5] => 2
                        

                             [3,4,2,5,1] => 4
                        

                             [3,4,5,1,2] => 3
                        

                             [3,4,5,2,1] => 3
                        

                             [3,5,1,2,4] => 2
                        

                             [3,5,1,4,2] => 2
                        

                             [3,5,2,1,4] => 2
                        

                             [3,5,2,4,1] => 2
                        

                             [3,5,4,1,2] => 2
                        

                             [3,5,4,2,1] => 2
                        

                             [4,1,2,3,5] => 1
                        

                             [4,1,2,5,3] => 2
                        

                             [4,1,3,2,5] => 1
                        

                             [4,1,3,5,2] => 3
                        

                             [4,1,5,2,3] => 2
                        

                             [4,1,5,3,2] => 2
                        

                             [4,2,1,3,5] => 1
                        

                             [4,2,1,5,3] => 2
                        

                             [4,2,3,1,5] => 2
                        

                             [4,2,3,5,1] => 4
                        

                             [4,2,5,1,3] => 3
                        

                             [4,2,5,3,1] => 3
                        

                             [4,3,1,2,5] => 1
                        

                             [4,3,1,5,2] => 3
                        

                             [4,3,2,1,5] => 1
                        

                             [4,3,2,5,1] => 4
                        

                             [4,3,5,1,2] => 3
                        

                             [4,3,5,2,1] => 3
                        

                             [4,5,1,2,3] => 2
                        

                             [4,5,1,3,2] => 2
                        

                             [4,5,2,1,3] => 2
                        

                             [4,5,2,3,1] => 2
                        

                             [4,5,3,1,2] => 2
                        

                             [4,5,3,2,1] => 2
                        

                             [5,1,2,3,4] => 1
                        

                             [5,1,2,4,3] => 1
                        

                             [5,1,3,2,4] => 1
                        

                             [5,1,3,4,2] => 2
                        

                             [5,1,4,2,3] => 1
                        

                             [5,1,4,3,2] => 1
                        

                             [5,2,1,3,4] => 1
                        

                             [5,2,1,4,3] => 1
                        

                             [5,2,3,1,4] => 2
                        

                             [5,2,3,4,1] => 3
                        

                             [5,2,4,1,3] => 2
                        

                             [5,2,4,3,1] => 2
                        

                             [5,3,1,2,4] => 1
                        

                             [5,3,1,4,2] => 2
                        

                             [5,3,2,1,4] => 1
                        

                             [5,3,2,4,1] => 3
                        

                             [5,3,4,1,2] => 2
                        

                             [5,3,4,2,1] => 2
                        

                             [5,4,1,2,3] => 1
                        

                             [5,4,1,3,2] => 1
                        

                             [5,4,2,1,3] => 1
                        

                             [5,4,2,3,1] => 2
                        

                             [5,4,3,1,2] => 1
                        

                             [5,4,3,2,1] => 1
                        

                             [1,2,3,4,5,6] => 0
                        

                             [1,2,3,4,6,5] => 1
                        

                             [1,2,3,5,4,6] => 1
                        

                             [1,2,3,5,6,4] => 2
                        

                             [1,2,3,6,4,5] => 1
                        

                             [1,2,3,6,5,4] => 1
                        

                             [1,2,4,3,5,6] => 1
                        

                             [1,2,4,3,6,5] => 1
                        

                             [1,2,4,5,3,6] => 2
                        

                             [1,2,4,5,6,3] => 3
                        

                             [1,2,4,6,3,5] => 2
                        

                             [1,2,4,6,5,3] => 2
                        

                             [1,2,5,3,4,6] => 1
                        

                             [1,2,5,3,6,4] => 2
                        

                             [1,2,5,4,3,6] => 1
                        

                             [1,2,5,4,6,3] => 3
                        

                             [1,2,5,6,3,4] => 2
                        

                             [1,2,5,6,4,3] => 2
                        

                             [1,2,6,3,4,5] => 1
                        

                             [1,2,6,3,5,4] => 1
                        

                             [1,2,6,4,3,5] => 1
                        

                             [1,2,6,4,5,3] => 2
                        

                             [1,2,6,5,3,4] => 1
                        

                             [1,2,6,5,4,3] => 1
                        

                             [1,3,2,4,5,6] => 1
                        

                             [1,3,2,4,6,5] => 1
                        

                             [1,3,2,5,4,6] => 1
                        

                             [1,3,2,5,6,4] => 2
                        

                             [1,3,2,6,4,5] => 1
                        

                             [1,3,2,6,5,4] => 1
                        

                             [1,3,4,2,5,6] => 2
                        

                             [1,3,4,2,6,5] => 2
                        

                             [1,3,4,5,2,6] => 3
                        

                             [1,3,4,5,6,2] => 4
                        

                             [1,3,4,6,2,5] => 3
                        

                             [1,3,4,6,5,2] => 3
                        

                             [1,3,5,2,4,6] => 2
                        

                             [1,3,5,2,6,4] => 2
                        

                             [1,3,5,4,2,6] => 2
                        

                             [1,3,5,4,6,2] => 4
                        

                             [1,3,5,6,2,4] => 3
                        

                             [1,3,5,6,4,2] => 3
                        

                             [1,3,6,2,4,5] => 2
                        

                             [1,3,6,2,5,4] => 2
                        

                             [1,3,6,4,2,5] => 2
                        

                             [1,3,6,4,5,2] => 3
                        

                             [1,3,6,5,2,4] => 2
                        

                             [1,3,6,5,4,2] => 2
                        

                             [1,4,2,3,5,6] => 1
                        

                             [1,4,2,3,6,5] => 1
                        

                             [1,4,2,5,3,6] => 2
                        

                             [1,4,2,5,6,3] => 3
                        

                             [1,4,2,6,3,5] => 2
                        

                             [1,4,2,6,5,3] => 2
                        

                             [1,4,3,2,5,6] => 1
                        

                             [1,4,3,2,6,5] => 1
                        

                             [1,4,3,5,2,6] => 3
                        

                             [1,4,3,5,6,2] => 4
                        

                             [1,4,3,6,2,5] => 3
                        

                             [1,4,3,6,5,2] => 3
                        

                             [1,4,5,2,3,6] => 2
                        

                             [1,4,5,2,6,3] => 3
                        

                             [1,4,5,3,2,6] => 2
                        

                             [1,4,5,3,6,2] => 4
                        

                             [1,4,5,6,2,3] => 3
                        

                             [1,4,5,6,3,2] => 3
                        

                             [1,4,6,2,3,5] => 2
                        

                             [1,4,6,2,5,3] => 2
                        

                             [1,4,6,3,2,5] => 2
                        

                             [1,4,6,3,5,2] => 2
                        

                             [1,4,6,5,2,3] => 2
                        

                             [1,4,6,5,3,2] => 2
                        

                             [1,5,2,3,4,6] => 1
                        

                             [1,5,2,3,6,4] => 2
                        

                             [1,5,2,4,3,6] => 1
                        

                             [1,5,2,4,6,3] => 3
                        

                             [1,5,2,6,3,4] => 2
                        

                             [1,5,2,6,4,3] => 2
                        

                             [1,5,3,2,4,6] => 1
                        

                             [1,5,3,2,6,4] => 2
                        

                             [1,5,3,4,2,6] => 2
                        

                             [1,5,3,4,6,2] => 4
                        

                             [1,5,3,6,2,4] => 3
                        

                             [1,5,3,6,4,2] => 3
                        

                             [1,5,4,2,3,6] => 1
                        

                             [1,5,4,2,6,3] => 3
                        

                             [1,5,4,3,2,6] => 1
                        

                             [1,5,4,3,6,2] => 4
                        

                             [1,5,4,6,2,3] => 3
                        

                             [1,5,4,6,3,2] => 3
                        

                             [1,5,6,2,3,4] => 2
                        

                             [1,5,6,2,4,3] => 2
                        

                             [1,5,6,3,2,4] => 2
                        

                             [1,5,6,3,4,2] => 2
                        

                             [1,5,6,4,2,3] => 2
                        

                             [1,5,6,4,3,2] => 2
                        

                             [1,6,2,3,4,5] => 1
                        

                             [1,6,2,3,5,4] => 1
                        

                             [1,6,2,4,3,5] => 1
                        

                             [1,6,2,4,5,3] => 2
                        

                             [1,6,2,5,3,4] => 1
                        

                             [1,6,2,5,4,3] => 1
                        

                             [1,6,3,2,4,5] => 1
                        

                             [1,6,3,2,5,4] => 1
                        

                             [1,6,3,4,2,5] => 2
                        

                             [1,6,3,4,5,2] => 3
                        

                             [1,6,3,5,2,4] => 2
                        

                             [1,6,3,5,4,2] => 2
                        

                             [1,6,4,2,3,5] => 1
                        

                             [1,6,4,2,5,3] => 2
                        

                             [1,6,4,3,2,5] => 1
                        

                             [1,6,4,3,5,2] => 3
                        

                             [1,6,4,5,2,3] => 2
                        

                             [1,6,4,5,3,2] => 2
                        

                             [1,6,5,2,3,4] => 1
                        

                             [1,6,5,2,4,3] => 1
                        

                             [1,6,5,3,2,4] => 1
                        

                             [1,6,5,3,4,2] => 2
                        

                             [1,6,5,4,2,3] => 1
                        

                             [1,6,5,4,3,2] => 1
                        

                             [2,1,3,4,5,6] => 1
                        

                             [2,1,3,4,6,5] => 1
                        

                             [2,1,3,5,4,6] => 1
                        

                             [2,1,3,5,6,4] => 2
                        

                             [2,1,3,6,4,5] => 1
                        

                             [2,1,3,6,5,4] => 1
                        

                             [2,1,4,3,5,6] => 1
                        

                             [2,1,4,3,6,5] => 1
                        

                             [2,1,4,5,3,6] => 2
                        

                             [2,1,4,5,6,3] => 3
                        

                             [2,1,4,6,3,5] => 2
                        

                             [2,1,4,6,5,3] => 2
                        

                             [2,1,5,3,4,6] => 1
                        

                             [2,1,5,3,6,4] => 2
                        

                             [2,1,5,4,3,6] => 1
                        

                             [2,1,5,4,6,3] => 3
                        

                             [2,1,5,6,3,4] => 2
                        

                             [2,1,5,6,4,3] => 2
                        

                             [2,1,6,3,4,5] => 1
                        

                             [2,1,6,3,5,4] => 1
                        

                             [2,1,6,4,3,5] => 1
                        

                             [2,1,6,4,5,3] => 2
                        

                             [2,1,6,5,3,4] => 1
                        

                             [2,1,6,5,4,3] => 1
                        

                             [2,3,1,4,5,6] => 2
                        

                             [2,3,1,4,6,5] => 2
                        

                             [2,3,1,5,4,6] => 2
                        

                             [2,3,1,5,6,4] => 2
                        

                             [2,3,1,6,4,5] => 2
                        

                             [2,3,1,6,5,4] => 2
                        

                             [2,3,4,1,5,6] => 3
                        

                             [2,3,4,1,6,5] => 3
                        

                             [2,3,4,5,1,6] => 4
                        

                             [2,3,4,5,6,1] => 5
                        

                             [2,3,4,6,1,5] => 4
                        

                             [2,3,4,6,5,1] => 4
                        

                             [2,3,5,1,4,6] => 3
                        

                             [2,3,5,1,6,4] => 3
                        

                             [2,3,5,4,1,6] => 3
                        

                             [2,3,5,4,6,1] => 5
                        

                             [2,3,5,6,1,4] => 4
                        

                             [2,3,5,6,4,1] => 4
                        

                             [2,3,6,1,4,5] => 3
                        

                             [2,3,6,1,5,4] => 3
                        

                             [2,3,6,4,1,5] => 3
                        

                             [2,3,6,4,5,1] => 4
                        

                             [2,3,6,5,1,4] => 3
                        

                             [2,3,6,5,4,1] => 3
                        

                             [2,4,1,3,5,6] => 2
                        

                             [2,4,1,3,6,5] => 2
                        

                             [2,4,1,5,3,6] => 2
                        

                             [2,4,1,5,6,3] => 3
                        

                             [2,4,1,6,3,5] => 2
                        

                             [2,4,1,6,5,3] => 2
                        

                             [2,4,3,1,5,6] => 2
                        

                             [2,4,3,1,6,5] => 2
                        

                             [2,4,3,5,1,6] => 4
                        

                             [2,4,3,5,6,1] => 5
                        

                             [2,4,3,6,1,5] => 4
                        

                             [2,4,3,6,5,1] => 4
                        

                             [2,4,5,1,3,6] => 3
                        

                             [2,4,5,1,6,3] => 3
                        

                             [2,4,5,3,1,6] => 3
                        

                             [2,4,5,3,6,1] => 5
                        

                             [2,4,5,6,1,3] => 4
                        

                             [2,4,5,6,3,1] => 4
                        

                             [2,4,6,1,3,5] => 3
                        

                             [2,4,6,1,5,3] => 3
                        

                             [2,4,6,3,1,5] => 3
                        

                             [2,4,6,3,5,1] => 3
                        

                             [2,4,6,5,1,3] => 3
                        

                             [2,4,6,5,3,1] => 3
                        

                             [2,5,1,3,4,6] => 2
                        

                             [2,5,1,3,6,4] => 2
                        

                             [2,5,1,4,3,6] => 2
                        

                             [2,5,1,4,6,3] => 3
                        

                             [2,5,1,6,3,4] => 2
                        

                             [2,5,1,6,4,3] => 2
                        

                             [2,5,3,1,4,6] => 2
                        

                             [2,5,3,1,6,4] => 2
                        

                             [2,5,3,4,1,6] => 3
                        

                             [2,5,3,4,6,1] => 5
                        

                             [2,5,3,6,1,4] => 4
                        

                             [2,5,3,6,4,1] => 4
                        

                             [2,5,4,1,3,6] => 2
                        

                             [2,5,4,1,6,3] => 3
                        

                             [2,5,4,3,1,6] => 2
                        

                             [2,5,4,3,6,1] => 5
                        

                             [2,5,4,6,1,3] => 4
                        

                             [2,5,4,6,3,1] => 4
                        

                             [2,5,6,1,3,4] => 3
                        

                             [2,5,6,1,4,3] => 3
                        

                             [2,5,6,3,1,4] => 3
                        

                             [2,5,6,3,4,1] => 3
                        

                             [2,5,6,4,1,3] => 3
                        

                             [2,5,6,4,3,1] => 3
                        

                             [2,6,1,3,4,5] => 2
                        

                             [2,6,1,3,5,4] => 2
                        

                             [2,6,1,4,3,5] => 2
                        

                             [2,6,1,4,5,3] => 2
                        

                             [2,6,1,5,3,4] => 2
                        

                             [2,6,1,5,4,3] => 2
                        

                             [2,6,3,1,4,5] => 2
                        

                             [2,6,3,1,5,4] => 2
                        

                             [2,6,3,4,1,5] => 3
                        

                             [2,6,3,4,5,1] => 4
                        

                             [2,6,3,5,1,4] => 3
                        

                             [2,6,3,5,4,1] => 3
                        

                             [2,6,4,1,3,5] => 2
                        

                             [2,6,4,1,5,3] => 2
                        

                             [2,6,4,3,1,5] => 2
                        

                             [2,6,4,3,5,1] => 4
                        

                             [2,6,4,5,1,3] => 3
                        

                             [2,6,4,5,3,1] => 3
                        

                             [2,6,5,1,3,4] => 2
                        

                             [2,6,5,1,4,3] => 2
                        

                             [2,6,5,3,1,4] => 2
                        

                             [2,6,5,3,4,1] => 3
                        

                             [2,6,5,4,1,3] => 2
                        

                             [2,6,5,4,3,1] => 2
                        

                             [3,1,2,4,5,6] => 1
                        

                             [3,1,2,4,6,5] => 1
                        

                             [3,1,2,5,4,6] => 1
                        

                             [3,1,2,5,6,4] => 2
                        

                             [3,1,2,6,4,5] => 1
                        

                             [3,1,2,6,5,4] => 1
                        

                             [3,1,4,2,5,6] => 2
                        

                             [3,1,4,2,6,5] => 2
                        

                             [3,1,4,5,2,6] => 3
                        

                             [3,1,4,5,6,2] => 4
                        

                             [3,1,4,6,2,5] => 3
                        

                             [3,1,4,6,5,2] => 3
                        

                             [3,1,5,2,4,6] => 2
                        

                             [3,1,5,2,6,4] => 2
                        

                             [3,1,5,4,2,6] => 2
                        

                             [3,1,5,4,6,2] => 4
                        

                             [3,1,5,6,2,4] => 3
                        

                             [3,1,5,6,4,2] => 3
                        

                             [3,1,6,2,4,5] => 2
                        

                             [3,1,6,2,5,4] => 2
                        

                             [3,1,6,4,2,5] => 2
                        

                             [3,1,6,4,5,2] => 3
                        

                             [3,1,6,5,2,4] => 2
                        

                             [3,1,6,5,4,2] => 2
                        

                             [3,2,1,4,5,6] => 1
                        

                             [3,2,1,4,6,5] => 1
                        

                             [3,2,1,5,4,6] => 1
                        

                             [3,2,1,5,6,4] => 2
                        

                             [3,2,1,6,4,5] => 1
                        

                             [3,2,1,6,5,4] => 1
                        

                             [3,2,4,1,5,6] => 3
                        

                             [3,2,4,1,6,5] => 3
                        

                             [3,2,4,5,1,6] => 4
                        

                             [3,2,4,5,6,1] => 5
                        

                             [3,2,4,6,1,5] => 4
                        

                             [3,2,4,6,5,1] => 4
                        

                             [3,2,5,1,4,6] => 3
                        

                             [3,2,5,1,6,4] => 3
                        

                             [3,2,5,4,1,6] => 3
                        

                             [3,2,5,4,6,1] => 5
                        

                             [3,2,5,6,1,4] => 4
                        

                             [3,2,5,6,4,1] => 4
                        

                             [3,2,6,1,4,5] => 3
                        

                             [3,2,6,1,5,4] => 3
                        

                             [3,2,6,4,1,5] => 3
                        

                             [3,2,6,4,5,1] => 4
                        

                             [3,2,6,5,1,4] => 3
                        

                             [3,2,6,5,4,1] => 3
                        

                             [3,4,1,2,5,6] => 2
                        

                             [3,4,1,2,6,5] => 2
                        

                             [3,4,1,5,2,6] => 3
                        

                             [3,4,1,5,6,2] => 4
                        

                             [3,4,1,6,2,5] => 3
                        

                             [3,4,1,6,5,2] => 3
                        

                             [3,4,2,1,5,6] => 2
                        

                             [3,4,2,1,6,5] => 2
                        

                             [3,4,2,5,1,6] => 4
                        

                             [3,4,2,5,6,1] => 5
                        

                             [3,4,2,6,1,5] => 4
                        

                             [3,4,2,6,5,1] => 4
                        

                             [3,4,5,1,2,6] => 3
                        

                             [3,4,5,1,6,2] => 4
                        

                             [3,4,5,2,1,6] => 3
                        

                             [3,4,5,2,6,1] => 5
                        

                             [3,4,5,6,1,2] => 4
                        

                             [3,4,5,6,2,1] => 4
                        

                             [3,4,6,1,2,5] => 3
                        

                             [3,4,6,1,5,2] => 3
                        

                             [3,4,6,2,1,5] => 3
                        

                             [3,4,6,2,5,1] => 3
                        

                             [3,4,6,5,1,2] => 3
                        

                             [3,4,6,5,2,1] => 3
                        

                             [3,5,1,2,4,6] => 2
                        

                             [3,5,1,2,6,4] => 2
                        

                             [3,5,1,4,2,6] => 2
                        

                             [3,5,1,4,6,2] => 4
                        

                             [3,5,1,6,2,4] => 3
                        

                             [3,5,1,6,4,2] => 3
                        

                             [3,5,2,1,4,6] => 2
                        

                             [3,5,2,1,6,4] => 2
                        

                             [3,5,2,4,1,6] => 2
                        

                             [3,5,2,4,6,1] => 5
                        

                             [3,5,2,6,1,4] => 4
                        

                             [3,5,2,6,4,1] => 4
                        

                             [3,5,4,1,2,6] => 2
                        

                             [3,5,4,1,6,2] => 4
                        

                             [3,5,4,2,1,6] => 2
                        

                             [3,5,4,2,6,1] => 5
                        

                             [3,5,4,6,1,2] => 4
                        

                             [3,5,4,6,2,1] => 4
                        

                             [3,5,6,1,2,4] => 3
                        

                             [3,5,6,1,4,2] => 3
                        

                             [3,5,6,2,1,4] => 3
                        

                             [3,5,6,2,4,1] => 3
                        

                             [3,5,6,4,1,2] => 3
                        

                             [3,5,6,4,2,1] => 3
                        

                             [3,6,1,2,4,5] => 2
                        

                             [3,6,1,2,5,4] => 2
                        

                             [3,6,1,4,2,5] => 2
                        

                             [3,6,1,4,5,2] => 3
                        

                             [3,6,1,5,2,4] => 2
                        

                             [3,6,1,5,4,2] => 2
                        

                             [3,6,2,1,4,5] => 2
                        

                             [3,6,2,1,5,4] => 2
                        

                             [3,6,2,4,1,5] => 2
                        

                             [3,6,2,4,5,1] => 4
                        

                             [3,6,2,5,1,4] => 2
                        

                             [3,6,2,5,4,1] => 2
                        

                             [3,6,4,1,2,5] => 2
                        

                             [3,6,4,1,5,2] => 3
                        

                             [3,6,4,2,1,5] => 2
                        

                             [3,6,4,2,5,1] => 4
                        

                             [3,6,4,5,1,2] => 3
                        

                             [3,6,4,5,2,1] => 3
                        

                             [3,6,5,1,2,4] => 2
                        

                             [3,6,5,1,4,2] => 2
                        

                             [3,6,5,2,1,4] => 2
                        

                             [3,6,5,2,4,1] => 2
                        

                             [3,6,5,4,1,2] => 2
                        

                             [3,6,5,4,2,1] => 2
                        

                             [4,1,2,3,5,6] => 1
                        

                             [4,1,2,3,6,5] => 1
                        

                             [4,1,2,5,3,6] => 2
                        

                             [4,1,2,5,6,3] => 3
                        

                             [4,1,2,6,3,5] => 2
                        

                             [4,1,2,6,5,3] => 2
                        

                             [4,1,3,2,5,6] => 1
                        

                             [4,1,3,2,6,5] => 1
                        

                             [4,1,3,5,2,6] => 3
                        

                             [4,1,3,5,6,2] => 4
                        

                             [4,1,3,6,2,5] => 3
                        

                             [4,1,3,6,5,2] => 3
                        

                             [4,1,5,2,3,6] => 2
                        

                             [4,1,5,2,6,3] => 3
                        

                             [4,1,5,3,2,6] => 2
                        

                             [4,1,5,3,6,2] => 4
                        

                             [4,1,5,6,2,3] => 3
                        

                             [4,1,5,6,3,2] => 3
                        

                             [4,1,6,2,3,5] => 2
                        

                             [4,1,6,2,5,3] => 2
                        

                             [4,1,6,3,2,5] => 2
                        

                             [4,1,6,3,5,2] => 2
                        

                             [4,1,6,5,2,3] => 2
                        

                             [4,1,6,5,3,2] => 2
                        

                             [4,2,1,3,5,6] => 1
                        

                             [4,2,1,3,6,5] => 1
                        

                             [4,2,1,5,3,6] => 2
                        

                             [4,2,1,5,6,3] => 3
                        

                             [4,2,1,6,3,5] => 2
                        

                             [4,2,1,6,5,3] => 2
                        

                             [4,2,3,1,5,6] => 2
                        

                             [4,2,3,1,6,5] => 2
                        

                             [4,2,3,5,1,6] => 4
                        

                             [4,2,3,5,6,1] => 5
                        

                             [4,2,3,6,1,5] => 4
                        

                             [4,2,3,6,5,1] => 4
                        

                             [4,2,5,1,3,6] => 3
                        

                             [4,2,5,1,6,3] => 3
                        

                             [4,2,5,3,1,6] => 3
                        

                             [4,2,5,3,6,1] => 5
                        

                             [4,2,5,6,1,3] => 4
                        

                             [4,2,5,6,3,1] => 4
                        

                             [4,2,6,1,3,5] => 3
                        

                             [4,2,6,1,5,3] => 3
                        

                             [4,2,6,3,1,5] => 3
                        

                             [4,2,6,3,5,1] => 3
                        

                             [4,2,6,5,1,3] => 3
                        

                             [4,2,6,5,3,1] => 3
                        

                             [4,3,1,2,5,6] => 1
                        

                             [4,3,1,2,6,5] => 1
                        

                             [4,3,1,5,2,6] => 3
                        

                             [4,3,1,5,6,2] => 4
                        

                             [4,3,1,6,2,5] => 3
                        

                             [4,3,1,6,5,2] => 3
                        

                             [4,3,2,1,5,6] => 1
                        

                             [4,3,2,1,6,5] => 1
                        

                             [4,3,2,5,1,6] => 4
                        

                             [4,3,2,5,6,1] => 5
                        

                             [4,3,2,6,1,5] => 4
                        

                             [4,3,2,6,5,1] => 4
                        

                             [4,3,5,1,2,6] => 3
                        

                             [4,3,5,1,6,2] => 4
                        

                             [4,3,5,2,1,6] => 3
                        

                             [4,3,5,2,6,1] => 5
                        

                             [4,3,5,6,1,2] => 4
                        

                             [4,3,5,6,2,1] => 4
                        

                             [4,3,6,1,2,5] => 3
                        

                             [4,3,6,1,5,2] => 3
                        

                             [4,3,6,2,1,5] => 3
                        

                             [4,3,6,2,5,1] => 3
                        

                             [4,3,6,5,1,2] => 3
                        

                             [4,3,6,5,2,1] => 3
                        

                             [4,5,1,2,3,6] => 2
                        

                             [4,5,1,2,6,3] => 3
                        

                             [4,5,1,3,2,6] => 2
                        

                             [4,5,1,3,6,2] => 4
                        

                             [4,5,1,6,2,3] => 3
                        

                             [4,5,1,6,3,2] => 3
                        

                             [4,5,2,1,3,6] => 2
                        

                             [4,5,2,1,6,3] => 3
                        

                             [4,5,2,3,1,6] => 2
                        

                             [4,5,2,3,6,1] => 5
                        

                             [4,5,2,6,1,3] => 4
                        

                             [4,5,2,6,3,1] => 4
                        

                             [4,5,3,1,2,6] => 2
                        

                             [4,5,3,1,6,2] => 4
                        

                             [4,5,3,2,1,6] => 2
                        

                             [4,5,3,2,6,1] => 5
                        

                             [4,5,3,6,1,2] => 4
                        

                             [4,5,3,6,2,1] => 4
                        

                             [4,5,6,1,2,3] => 3
                        

                             [4,5,6,1,3,2] => 3
                        

                             [4,5,6,2,1,3] => 3
                        

                             [4,5,6,2,3,1] => 3
                        

                             [4,5,6,3,1,2] => 3
                        

                             [4,5,6,3,2,1] => 3
                        

                             [4,6,1,2,3,5] => 2
                        

                             [4,6,1,2,5,3] => 2
                        

                             [4,6,1,3,2,5] => 2
                        

                             [4,6,1,3,5,2] => 2
                        

                             [4,6,1,5,2,3] => 2
                        

                             [4,6,1,5,3,2] => 2
                        

                             [4,6,2,1,3,5] => 2
                        

                             [4,6,2,1,5,3] => 2
                        

                             [4,6,2,3,1,5] => 2
                        

                             [4,6,2,3,5,1] => 3
                        

                             [4,6,2,5,1,3] => 2
                        

                             [4,6,2,5,3,1] => 2
                        

                             [4,6,3,1,2,5] => 2
                        

                             [4,6,3,1,5,2] => 2
                        

                             [4,6,3,2,1,5] => 2
                        

                             [4,6,3,2,5,1] => 3
                        

                             [4,6,3,5,1,2] => 2
                        

                             [4,6,3,5,2,1] => 2
                        

                             [4,6,5,1,2,3] => 2
                        

                             [4,6,5,1,3,2] => 2
                        

                             [4,6,5,2,1,3] => 2
                        

                             [4,6,5,2,3,1] => 2
                        

                             [4,6,5,3,1,2] => 2
                        

                             [4,6,5,3,2,1] => 2
                        

                             [5,1,2,3,4,6] => 1
                        

                             [5,1,2,3,6,4] => 2
                        

                             [5,1,2,4,3,6] => 1
                        

                             [5,1,2,4,6,3] => 3
                        

                             [5,1,2,6,3,4] => 2
                        

                             [5,1,2,6,4,3] => 2
                        

                             [5,1,3,2,4,6] => 1
                        

                             [5,1,3,2,6,4] => 2
                        

                             [5,1,3,4,2,6] => 2
                        

                             [5,1,3,4,6,2] => 4
                        

                             [5,1,3,6,2,4] => 3
                        

                             [5,1,3,6,4,2] => 3
                        

                             [5,1,4,2,3,6] => 1
                        

                             [5,1,4,2,6,3] => 3
                        

                             [5,1,4,3,2,6] => 1
                        

                             [5,1,4,3,6,2] => 4
                        

                             [5,1,4,6,2,3] => 3
                        

                             [5,1,4,6,3,2] => 3
                        

                             [5,1,6,2,3,4] => 2
                        

                             [5,1,6,2,4,3] => 2
                        

                             [5,1,6,3,2,4] => 2
                        

                             [5,1,6,3,4,2] => 2
                        

                             [5,1,6,4,2,3] => 2
                        

                             [5,1,6,4,3,2] => 2
                        

                             [5,2,1,3,4,6] => 1
                        

                             [5,2,1,3,6,4] => 2
                        

                             [5,2,1,4,3,6] => 1
                        

                             [5,2,1,4,6,3] => 3
                        

                             [5,2,1,6,3,4] => 2
                        

                             [5,2,1,6,4,3] => 2
                        

                             [5,2,3,1,4,6] => 2
                        

                             [5,2,3,1,6,4] => 2
                        

                             [5,2,3,4,1,6] => 3
                        

                             [5,2,3,4,6,1] => 5
                        

                             [5,2,3,6,1,4] => 4
                        

                             [5,2,3,6,4,1] => 4
                        

                             [5,2,4,1,3,6] => 2
                        

                             [5,2,4,1,6,3] => 3
                        

                             [5,2,4,3,1,6] => 2
                        

                             [5,2,4,3,6,1] => 5
                        

                             [5,2,4,6,1,3] => 4
                        

                             [5,2,4,6,3,1] => 4
                        

                             [5,2,6,1,3,4] => 3
                        

                             [5,2,6,1,4,3] => 3
                        

                             [5,2,6,3,1,4] => 3
                        

                             [5,2,6,3,4,1] => 3
                        

                             [5,2,6,4,1,3] => 3
                        

                             [5,2,6,4,3,1] => 3
                        

                             [5,3,1,2,4,6] => 1
                        

                             [5,3,1,2,6,4] => 2
                        

                             [5,3,1,4,2,6] => 2
                        

                             [5,3,1,4,6,2] => 4
                        

                             [5,3,1,6,2,4] => 3
                        

                             [5,3,1,6,4,2] => 3
                        

                             [5,3,2,1,4,6] => 1
                        

                             [5,3,2,1,6,4] => 2
                        

                             [5,3,2,4,1,6] => 3
                        

                             [5,3,2,4,6,1] => 5
                        

                             [5,3,2,6,1,4] => 4
                        

                             [5,3,2,6,4,1] => 4
                        

                             [5,3,4,1,2,6] => 2
                        

                             [5,3,4,1,6,2] => 4
                        

                             [5,3,4,2,1,6] => 2
                        

                             [5,3,4,2,6,1] => 5
                        

                             [5,3,4,6,1,2] => 4
                        

                             [5,3,4,6,2,1] => 4
                        

                             [5,3,6,1,2,4] => 3
                        

                             [5,3,6,1,4,2] => 3
                        

                             [5,3,6,2,1,4] => 3
                        

                             [5,3,6,2,4,1] => 3
                        

                             [5,3,6,4,1,2] => 3
                        

                             [5,3,6,4,2,1] => 3
                        

                             [5,4,1,2,3,6] => 1
                        

                             [5,4,1,2,6,3] => 3
                        

                             [5,4,1,3,2,6] => 1
                        

                             [5,4,1,3,6,2] => 4
                        

                             [5,4,1,6,2,3] => 3
                        

                             [5,4,1,6,3,2] => 3
                        

                             [5,4,2,1,3,6] => 1
                        

                             [5,4,2,1,6,3] => 3
                        

                             [5,4,2,3,1,6] => 2
                        

                             [5,4,2,3,6,1] => 5
                        

                             [5,4,2,6,1,3] => 4
                        

                             [5,4,2,6,3,1] => 4
                        

                             [5,4,3,1,2,6] => 1
                        

                             [5,4,3,1,6,2] => 4
                        

                             [5,4,3,2,1,6] => 1
                        

                             [5,4,3,2,6,1] => 5
                        

                             [5,4,3,6,1,2] => 4
                        

                             [5,4,3,6,2,1] => 4
                        

                             [5,4,6,1,2,3] => 3
                        

                             [5,4,6,1,3,2] => 3
                        

                             [5,4,6,2,1,3] => 3
                        

                             [5,4,6,2,3,1] => 3
                        

                             [5,4,6,3,1,2] => 3
                        

                             [5,4,6,3,2,1] => 3
                        

                             [5,6,1,2,3,4] => 2
                        

                             [5,6,1,2,4,3] => 2
                        

                             [5,6,1,3,2,4] => 2
                        

                             [5,6,1,3,4,2] => 2
                        

                             [5,6,1,4,2,3] => 2
                        

                             [5,6,1,4,3,2] => 2
                        

                             [5,6,2,1,3,4] => 2
                        

                             [5,6,2,1,4,3] => 2
                        

                             [5,6,2,3,1,4] => 2
                        

                             [5,6,2,3,4,1] => 3
                        

                             [5,6,2,4,1,3] => 2
                        

                             [5,6,2,4,3,1] => 2
                        

                             [5,6,3,1,2,4] => 2
                        

                             [5,6,3,1,4,2] => 2
                        

                             [5,6,3,2,1,4] => 2
                        

                             [5,6,3,2,4,1] => 3
                        

                             [5,6,3,4,1,2] => 2
                        

                             [5,6,3,4,2,1] => 2
                        

                             [5,6,4,1,2,3] => 2
                        

                             [5,6,4,1,3,2] => 2
                        

                             [5,6,4,2,1,3] => 2
                        

                             [5,6,4,2,3,1] => 2
                        

                             [5,6,4,3,1,2] => 2
                        

                             [5,6,4,3,2,1] => 2
                        

                             [6,1,2,3,4,5] => 1
                        

                             [6,1,2,3,5,4] => 1
                        

                             [6,1,2,4,3,5] => 1
                        

                             [6,1,2,4,5,3] => 2
                        

                             [6,1,2,5,3,4] => 1
                        

                             [6,1,2,5,4,3] => 1
                        

                             [6,1,3,2,4,5] => 1
                        

                             [6,1,3,2,5,4] => 1
                        

                             [6,1,3,4,2,5] => 2
                        

                             [6,1,3,4,5,2] => 3
                        

                             [6,1,3,5,2,4] => 2
                        

                             [6,1,3,5,4,2] => 2
                        

                             [6,1,4,2,3,5] => 1
                        

                             [6,1,4,2,5,3] => 2
                        

                             [6,1,4,3,2,5] => 1
                        

                             [6,1,4,3,5,2] => 3
                        

                             [6,1,4,5,2,3] => 2
                        

                             [6,1,4,5,3,2] => 2
                        

                             [6,1,5,2,3,4] => 1
                        

                             [6,1,5,2,4,3] => 1
                        

                             [6,1,5,3,2,4] => 1
                        

                             [6,1,5,3,4,2] => 2
                        

                             [6,1,5,4,2,3] => 1
                        

                             [6,1,5,4,3,2] => 1
                        

                             [6,2,1,3,4,5] => 1
                        

                             [6,2,1,3,5,4] => 1
                        

                             [6,2,1,4,3,5] => 1
                        

                             [6,2,1,4,5,3] => 2
                        

                             [6,2,1,5,3,4] => 1
                        

                             [6,2,1,5,4,3] => 1
                        

                             [6,2,3,1,4,5] => 2
                        

                             [6,2,3,1,5,4] => 2
                        

                             [6,2,3,4,1,5] => 3
                        

                             [6,2,3,4,5,1] => 4
                        

                             [6,2,3,5,1,4] => 3
                        

                             [6,2,3,5,4,1] => 3
                        

                             [6,2,4,1,3,5] => 2
                        

                             [6,2,4,1,5,3] => 2
                        

                             [6,2,4,3,1,5] => 2
                        

                             [6,2,4,3,5,1] => 4
                        

                             [6,2,4,5,1,3] => 3
                        

                             [6,2,4,5,3,1] => 3
                        

                             [6,2,5,1,3,4] => 2
                        

                             [6,2,5,1,4,3] => 2
                        

                             [6,2,5,3,1,4] => 2
                        

                             [6,2,5,3,4,1] => 3
                        

                             [6,2,5,4,1,3] => 2
                        

                             [6,2,5,4,3,1] => 2
                        

                             [6,3,1,2,4,5] => 1
                        

                             [6,3,1,2,5,4] => 1
                        

                             [6,3,1,4,2,5] => 2
                        

                             [6,3,1,4,5,2] => 3
                        

                             [6,3,1,5,2,4] => 2
                        

                             [6,3,1,5,4,2] => 2
                        

                             [6,3,2,1,4,5] => 1
                        

                             [6,3,2,1,5,4] => 1
                        

                             [6,3,2,4,1,5] => 3
                        

                             [6,3,2,4,5,1] => 4
                        

                             [6,3,2,5,1,4] => 3
                        

                             [6,3,2,5,4,1] => 3
                        

                             [6,3,4,1,2,5] => 2
                        

                             [6,3,4,1,5,2] => 3
                        

                             [6,3,4,2,1,5] => 2
                        

                             [6,3,4,2,5,1] => 4
                        

                             [6,3,4,5,1,2] => 3
                        

                             [6,3,4,5,2,1] => 3
                        

                             [6,3,5,1,2,4] => 2
                        

                             [6,3,5,1,4,2] => 2
                        

                             [6,3,5,2,1,4] => 2
                        

                             [6,3,5,2,4,1] => 2
                        

                             [6,3,5,4,1,2] => 2
                        

                             [6,3,5,4,2,1] => 2
                        

                             [6,4,1,2,3,5] => 1
                        

                             [6,4,1,2,5,3] => 2
                        

                             [6,4,1,3,2,5] => 1
                        

                             [6,4,1,3,5,2] => 3
                        

                             [6,4,1,5,2,3] => 2
                        

                             [6,4,1,5,3,2] => 2
                        

                             [6,4,2,1,3,5] => 1
                        

                             [6,4,2,1,5,3] => 2
                        

                             [6,4,2,3,1,5] => 2
                        

                             [6,4,2,3,5,1] => 4
                        

                             [6,4,2,5,1,3] => 3
                        

                             [6,4,2,5,3,1] => 3
                        

                             [6,4,3,1,2,5] => 1
                        

                             [6,4,3,1,5,2] => 3
                        

                             [6,4,3,2,1,5] => 1
                        

                             [6,4,3,2,5,1] => 4
                        

                             [6,4,3,5,1,2] => 3
                        

                             [6,4,3,5,2,1] => 3
                        

                             [6,4,5,1,2,3] => 2
                        

                             [6,4,5,1,3,2] => 2
                        

                             [6,4,5,2,1,3] => 2
                        

                             [6,4,5,2,3,1] => 2
                        

                             [6,4,5,3,1,2] => 2
                        

                             [6,4,5,3,2,1] => 2
                        

                             [6,5,1,2,3,4] => 1
                        

                             [6,5,1,2,4,3] => 1
                        

                             [6,5,1,3,2,4] => 1
                        

                             [6,5,1,3,4,2] => 2
                        

                             [6,5,1,4,2,3] => 1
                        

                             [6,5,1,4,3,2] => 1
                        

                             [6,5,2,1,3,4] => 1
                        

                             [6,5,2,1,4,3] => 1
                        

                             [6,5,2,3,1,4] => 2
                        

                             [6,5,2,3,4,1] => 3
                        

                             [6,5,2,4,1,3] => 2
                        

                             [6,5,2,4,3,1] => 2
                        

                             [6,5,3,1,2,4] => 1
                        

                             [6,5,3,1,4,2] => 2
                        

                             [6,5,3,2,1,4] => 1
                        

                             [6,5,3,2,4,1] => 3
                        

                             [6,5,3,4,1,2] => 2
                        

                             [6,5,3,4,2,1] => 2
                        

                             [6,5,4,1,2,3] => 1
                        

                             [6,5,4,1,3,2] => 1
                        

                             [6,5,4,2,1,3] => 1
                        

                             [6,5,4,2,3,1] => 2
                        

                             [6,5,4,3,1,2] => 1
                        

                             [6,5,4,3,2,1] => 1
                        

Search for values or
search for distribution
Download as text // json // pdf
 
Description
The number of stack-sorts needed to sort a permutation.
A permutation is (West) $t$-stack sortable if it is sortable using $t$ stacks in series.
Let $W_t(n,k)$ be the number of permutations of size $n$
with $k$ descents which are $t$-stack sortable. Then the polynomials $W_{n,t}(x) = \sum_{k=0}^n W_t(n,k)x^k$
are symmetric and unimodal.
We have $W_{n,1}(x) = A_n(x)$, the Eulerian polynomials. One can show that $W_{n,1}(x)$ and $W_{n,2}(x)$ are real-rooted.
References
[1] Bóna, Miklós A survey of stack-sorting disciplines MathSciNet:2028290
[2] Úlfarsson, H. Describing West-3-stack-sortable permutations with permutation patterns arXiv:1110.1219
[3] Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!). Also called Segner numbers. OEIS:A000108
Code
def stack_sort(x):
    stack = []
    result = []
    for e in x:
        while stack and e > stack[-1]:
            result += [stack.pop()]
        stack.append(e)
    while stack:
        result += [stack.pop()]
    return Permutation(result)

def statistic(x):
    i = 0
    id = Permutations(x.size()).identity()
    while x != id:
        x = stack_sort(x)
        i += 1
    return i

Created
Aug 05, 2012 at 10:27 by Per Alexandersson
Updated
May 29, 2015 at 15:55 by Martin Rubey

StatisticsDatabase (last edited 2013-02-15 14:27:38 by ChristianStump)