Identifier
Identifier
Values
[] => 0
[1] => 1
[1,2] => 4
[2,1] => 0
[1,2,3] => 9
[1,3,2] => 4
[2,1,3] => 0
[2,3,1] => 4
[3,1,2] => 0
[3,2,1] => 1
[1,2,3,4] => 16
[1,2,4,3] => 10
[1,3,2,4] => 6
[1,3,4,2] => 10
[1,4,2,3] => 6
[1,4,3,2] => 6
[2,1,3,4] => 0
[2,1,4,3] => 0
[2,3,1,4] => 6
[2,3,4,1] => 10
[2,4,1,3] => 4
[2,4,3,1] => 6
[3,1,2,4] => 0
[3,1,4,2] => 0
[3,2,1,4] => 2
[3,2,4,1] => 0
[3,4,1,2] => 4
[3,4,2,1] => 6
[4,1,2,3] => 0
[4,1,3,2] => 0
[4,2,1,3] => 2
[4,2,3,1] => 0
[4,3,1,2] => 2
[4,3,2,1] => 0
[1,2,3,4,5] => 25
[1,2,3,5,4] => 18
[1,2,4,3,5] => 14
[1,2,4,5,3] => 18
[1,2,5,3,4] => 14
[1,2,5,4,3] => 13
[1,3,2,4,5] => 8
[1,3,2,5,4] => 7
[1,3,4,2,5] => 14
[1,3,4,5,2] => 18
[1,3,5,2,4] => 11
[1,3,5,4,2] => 13
[1,4,2,3,5] => 8
[1,4,2,5,3] => 7
[1,4,3,2,5] => 9
[1,4,3,5,2] => 7
[1,4,5,2,3] => 11
[1,4,5,3,2] => 13
[1,5,2,3,4] => 8
[1,5,2,4,3] => 7
[1,5,3,2,4] => 9
[1,5,3,4,2] => 7
[1,5,4,2,3] => 9
[1,5,4,3,2] => 6
[2,1,3,4,5] => 0
[2,1,3,5,4] => 0
[2,1,4,3,5] => 0
[2,1,4,5,3] => 0
[2,1,5,3,4] => 0
[2,1,5,4,3] => 0
[2,3,1,4,5] => 8
[2,3,1,5,4] => 7
[2,3,4,1,5] => 14
[2,3,4,5,1] => 18
[2,3,5,1,4] => 11
[2,3,5,4,1] => 13
[2,4,1,3,5] => 5
[2,4,1,5,3] => 7
[2,4,3,1,5] => 9
[2,4,3,5,1] => 7
[2,4,5,1,3] => 11
[2,4,5,3,1] => 13
[2,5,1,3,4] => 5
[2,5,1,4,3] => 5
[2,5,3,1,4] => 9
[2,5,3,4,1] => 7
[2,5,4,1,3] => 7
[2,5,4,3,1] => 6
[3,1,2,4,5] => 0
[3,1,2,5,4] => 0
[3,1,4,2,5] => 0
[3,1,4,5,2] => 0
[3,1,5,2,4] => 0
[3,1,5,4,2] => 0
[3,2,1,4,5] => 3
[3,2,1,5,4] => 3
[3,2,4,1,5] => 0
[3,2,4,5,1] => 0
[3,2,5,1,4] => 0
[3,2,5,4,1] => 0
[3,4,1,2,5] => 5
[3,4,1,5,2] => 7
[3,4,2,1,5] => 9
[3,4,2,5,1] => 7
[3,4,5,1,2] => 11
[3,4,5,2,1] => 13
[3,5,1,2,4] => 5
[3,5,1,4,2] => 5
[3,5,2,1,4] => 7
[3,5,2,4,1] => 5
[3,5,4,1,2] => 7
[3,5,4,2,1] => 6
[4,1,2,3,5] => 0
[4,1,2,5,3] => 0
[4,1,3,2,5] => 0
[4,1,3,5,2] => 0
[4,1,5,2,3] => 0
[4,1,5,3,2] => 0
[4,2,1,3,5] => 3
[4,2,1,5,3] => 3
[4,2,3,1,5] => 0
[4,2,3,5,1] => 0
[4,2,5,1,3] => 0
[4,2,5,3,1] => 0
[4,3,1,2,5] => 3
[4,3,1,5,2] => 3
[4,3,2,1,5] => 0
[4,3,2,5,1] => 2
[4,3,5,1,2] => 0
[4,3,5,2,1] => 0
[4,5,1,2,3] => 5
[4,5,1,3,2] => 5
[4,5,2,1,3] => 7
[4,5,2,3,1] => 5
[4,5,3,1,2] => 7
[4,5,3,2,1] => 6
[5,1,2,3,4] => 0
[5,1,2,4,3] => 0
[5,1,3,2,4] => 0
[5,1,3,4,2] => 0
[5,1,4,2,3] => 0
[5,1,4,3,2] => 0
[5,2,1,3,4] => 3
[5,2,1,4,3] => 3
[5,2,3,1,4] => 0
[5,2,3,4,1] => 0
[5,2,4,1,3] => 0
[5,2,4,3,1] => 0
[5,3,1,2,4] => 3
[5,3,1,4,2] => 3
[5,3,2,1,4] => 0
[5,3,2,4,1] => 2
[5,3,4,1,2] => 0
[5,3,4,2,1] => 0
[5,4,1,2,3] => 3
[5,4,1,3,2] => 2
[5,4,2,1,3] => 0
[5,4,2,3,1] => 2
[5,4,3,1,2] => 0
[5,4,3,2,1] => 1
[1,2,3,4,5,6] => 36
[1,2,3,4,6,5] => 28
[1,2,3,5,4,6] => 24
[1,2,3,5,6,4] => 28
[1,2,3,6,4,5] => 24
[1,2,3,6,5,4] => 22
[1,2,4,3,5,6] => 18
[1,2,4,3,6,5] => 16
[1,2,4,5,3,6] => 24
[1,2,4,5,6,3] => 28
[1,2,4,6,3,5] => 20
[1,2,4,6,5,3] => 22
[1,2,5,3,4,6] => 18
[1,2,5,3,6,4] => 16
[1,2,5,4,3,6] => 18
[1,2,5,4,6,3] => 16
[1,2,5,6,3,4] => 20
[1,2,5,6,4,3] => 22
[1,2,6,3,4,5] => 18
[1,2,6,3,5,4] => 16
[1,2,6,4,3,5] => 18
[1,2,6,4,5,3] => 16
[1,2,6,5,3,4] => 18
[1,2,6,5,4,3] => 14
[1,3,2,4,5,6] => 10
[1,3,2,4,6,5] => 9
[1,3,2,5,4,6] => 9
[1,3,2,5,6,4] => 9
[1,3,2,6,4,5] => 9
[1,3,2,6,5,4] => 8
[1,3,4,2,5,6] => 18
[1,3,4,2,6,5] => 16
[1,3,4,5,2,6] => 24
[1,3,4,5,6,2] => 28
[1,3,4,6,2,5] => 20
[1,3,4,6,5,2] => 22
[1,3,5,2,4,6] => 14
[1,3,5,2,6,4] => 16
[1,3,5,4,2,6] => 18
[1,3,5,4,6,2] => 16
[1,3,5,6,2,4] => 20
[1,3,5,6,4,2] => 22
[1,3,6,2,4,5] => 14
[1,3,6,2,5,4] => 13
[1,3,6,4,2,5] => 18
[1,3,6,4,5,2] => 16
[1,3,6,5,2,4] => 15
[1,3,6,5,4,2] => 14
[1,4,2,3,5,6] => 10
[1,4,2,3,6,5] => 9
[1,4,2,5,3,6] => 9
[1,4,2,5,6,3] => 9
[1,4,2,6,3,5] => 9
[1,4,2,6,5,3] => 8
[1,4,3,2,5,6] => 12
[1,4,3,2,6,5] => 11
[1,4,3,5,2,6] => 9
[1,4,3,5,6,2] => 9
[1,4,3,6,2,5] => 8
[1,4,3,6,5,2] => 8
[1,4,5,2,3,6] => 14
[1,4,5,2,6,3] => 16
[1,4,5,3,2,6] => 18
[1,4,5,3,6,2] => 16
[1,4,5,6,2,3] => 20
[1,4,5,6,3,2] => 22
[1,4,6,2,3,5] => 14
[1,4,6,2,5,3] => 13
[1,4,6,3,2,5] => 15
[1,4,6,3,5,2] => 13
[1,4,6,5,2,3] => 15
[1,4,6,5,3,2] => 14
[1,5,2,3,4,6] => 10
[1,5,2,3,6,4] => 9
[1,5,2,4,3,6] => 9
[1,5,2,4,6,3] => 9
[1,5,2,6,3,4] => 9
[1,5,2,6,4,3] => 8
[1,5,3,2,4,6] => 12
[1,5,3,2,6,4] => 11
[1,5,3,4,2,6] => 9
[1,5,3,4,6,2] => 9
[1,5,3,6,2,4] => 8
[1,5,3,6,4,2] => 8
[1,5,4,2,3,6] => 12
[1,5,4,2,6,3] => 11
[1,5,4,3,2,6] => 8
[1,5,4,3,6,2] => 10
[1,5,4,6,2,3] => 8
[1,5,4,6,3,2] => 8
[1,5,6,2,3,4] => 14
[1,5,6,2,4,3] => 13
[1,5,6,3,2,4] => 15
[1,5,6,3,4,2] => 13
[1,5,6,4,2,3] => 15
[1,5,6,4,3,2] => 14
[1,6,2,3,4,5] => 10
[1,6,2,3,5,4] => 9
[1,6,2,4,3,5] => 9
[1,6,2,4,5,3] => 9
[1,6,2,5,3,4] => 9
[1,6,2,5,4,3] => 8
[1,6,3,2,4,5] => 12
[1,6,3,2,5,4] => 11
[1,6,3,4,2,5] => 9
[1,6,3,4,5,2] => 9
[1,6,3,5,2,4] => 8
[1,6,3,5,4,2] => 8
[1,6,4,2,3,5] => 12
[1,6,4,2,5,3] => 11
[1,6,4,3,2,5] => 8
[1,6,4,3,5,2] => 10
[1,6,4,5,2,3] => 8
[1,6,4,5,3,2] => 8
[1,6,5,2,3,4] => 12
[1,6,5,2,4,3] => 10
[1,6,5,3,2,4] => 8
[1,6,5,3,4,2] => 10
[1,6,5,4,2,3] => 8
[1,6,5,4,3,2] => 8
[2,1,3,4,5,6] => 0
[2,1,3,4,6,5] => 0
[2,1,3,5,4,6] => 0
[2,1,3,5,6,4] => 0
[2,1,3,6,4,5] => 0
[2,1,3,6,5,4] => 0
[2,1,4,3,5,6] => 0
[2,1,4,3,6,5] => 0
[2,1,4,5,3,6] => 0
[2,1,4,5,6,3] => 0
[2,1,4,6,3,5] => 0
[2,1,4,6,5,3] => 0
[2,1,5,3,4,6] => 0
[2,1,5,3,6,4] => 0
[2,1,5,4,3,6] => 0
[2,1,5,4,6,3] => 0
[2,1,5,6,3,4] => 0
[2,1,5,6,4,3] => 0
[2,1,6,3,4,5] => 0
[2,1,6,3,5,4] => 0
[2,1,6,4,3,5] => 0
[2,1,6,4,5,3] => 0
[2,1,6,5,3,4] => 0
[2,1,6,5,4,3] => 0
[2,3,1,4,5,6] => 10
[2,3,1,4,6,5] => 9
[2,3,1,5,4,6] => 9
[2,3,1,5,6,4] => 9
[2,3,1,6,4,5] => 9
[2,3,1,6,5,4] => 8
[2,3,4,1,5,6] => 18
[2,3,4,1,6,5] => 16
[2,3,4,5,1,6] => 24
[2,3,4,5,6,1] => 28
[2,3,4,6,1,5] => 20
[2,3,4,6,5,1] => 22
[2,3,5,1,4,6] => 14
[2,3,5,1,6,4] => 16
[2,3,5,4,1,6] => 18
[2,3,5,4,6,1] => 16
[2,3,5,6,1,4] => 20
[2,3,5,6,4,1] => 22
[2,3,6,1,4,5] => 14
[2,3,6,1,5,4] => 13
[2,3,6,4,1,5] => 18
[2,3,6,4,5,1] => 16
[2,3,6,5,1,4] => 15
[2,3,6,5,4,1] => 14
[2,4,1,3,5,6] => 6
[2,4,1,3,6,5] => 7
[2,4,1,5,3,6] => 9
[2,4,1,5,6,3] => 9
[2,4,1,6,3,5] => 7
[2,4,1,6,5,3] => 8
[2,4,3,1,5,6] => 12
[2,4,3,1,6,5] => 11
[2,4,3,5,1,6] => 9
[2,4,3,5,6,1] => 9
[2,4,3,6,1,5] => 8
[2,4,3,6,5,1] => 8
[2,4,5,1,3,6] => 14
[2,4,5,1,6,3] => 16
[2,4,5,3,1,6] => 18
[2,4,5,3,6,1] => 16
[2,4,5,6,1,3] => 20
[2,4,5,6,3,1] => 22
[2,4,6,1,3,5] => 12
[2,4,6,1,5,3] => 13
[2,4,6,3,1,5] => 15
[2,4,6,3,5,1] => 13
[2,4,6,5,1,3] => 15
[2,4,6,5,3,1] => 14
[2,5,1,3,4,6] => 6
[2,5,1,3,6,4] => 7
[2,5,1,4,3,6] => 6
[2,5,1,4,6,3] => 6
[2,5,1,6,3,4] => 7
[2,5,1,6,4,3] => 8
[2,5,3,1,4,6] => 12
[2,5,3,1,6,4] => 11
[2,5,3,4,1,6] => 9
[2,5,3,4,6,1] => 9
[2,5,3,6,1,4] => 8
[2,5,3,6,4,1] => 8
[2,5,4,1,3,6] => 9
[2,5,4,1,6,3] => 11
[2,5,4,3,1,6] => 8
[2,5,4,3,6,1] => 10
[2,5,4,6,1,3] => 8
[2,5,4,6,3,1] => 8
[2,5,6,1,3,4] => 12
[2,5,6,1,4,3] => 13
[2,5,6,3,1,4] => 15
[2,5,6,3,4,1] => 13
[2,5,6,4,1,3] => 15
[2,5,6,4,3,1] => 14
[2,6,1,3,4,5] => 6
[2,6,1,3,5,4] => 6
[2,6,1,4,3,5] => 6
[2,6,1,4,5,3] => 6
[2,6,1,5,3,4] => 6
[2,6,1,5,4,3] => 6
[2,6,3,1,4,5] => 12
[2,6,3,1,5,4] => 11
[2,6,3,4,1,5] => 9
[2,6,3,4,5,1] => 9
[2,6,3,5,1,4] => 8
[2,6,3,5,4,1] => 8
[2,6,4,1,3,5] => 9
[2,6,4,1,5,3] => 11
[2,6,4,3,1,5] => 8
[2,6,4,3,5,1] => 10
[2,6,4,5,1,3] => 8
[2,6,4,5,3,1] => 8
[2,6,5,1,3,4] => 9
[2,6,5,1,4,3] => 8
[2,6,5,3,1,4] => 8
[2,6,5,3,4,1] => 10
[2,6,5,4,1,3] => 6
[2,6,5,4,3,1] => 8
[3,1,2,4,5,6] => 0
[3,1,2,4,6,5] => 0
[3,1,2,5,4,6] => 0
[3,1,2,5,6,4] => 0
[3,1,2,6,4,5] => 0
[3,1,2,6,5,4] => 0
[3,1,4,2,5,6] => 0
[3,1,4,2,6,5] => 0
[3,1,4,5,2,6] => 0
[3,1,4,5,6,2] => 0
[3,1,4,6,2,5] => 0
[3,1,4,6,5,2] => 0
[3,1,5,2,4,6] => 0
[3,1,5,2,6,4] => 0
[3,1,5,4,2,6] => 0
[3,1,5,4,6,2] => 0
[3,1,5,6,2,4] => 0
[3,1,5,6,4,2] => 0
[3,1,6,2,4,5] => 0
[3,1,6,2,5,4] => 0
[3,1,6,4,2,5] => 0
[3,1,6,4,5,2] => 0
[3,1,6,5,2,4] => 0
[3,1,6,5,4,2] => 0
[3,2,1,4,5,6] => 4
[3,2,1,4,6,5] => 4
[3,2,1,5,4,6] => 4
[3,2,1,5,6,4] => 4
[3,2,1,6,4,5] => 4
[3,2,1,6,5,4] => 5
[3,2,4,1,5,6] => 0
[3,2,4,1,6,5] => 0
[3,2,4,5,1,6] => 0
[3,2,4,5,6,1] => 0
[3,2,4,6,1,5] => 0
[3,2,4,6,5,1] => 0
[3,2,5,1,4,6] => 0
[3,2,5,1,6,4] => 0
[3,2,5,4,1,6] => 0
[3,2,5,4,6,1] => 0
[3,2,5,6,1,4] => 0
[3,2,5,6,4,1] => 0
[3,2,6,1,4,5] => 0
[3,2,6,1,5,4] => 0
[3,2,6,4,1,5] => 0
[3,2,6,4,5,1] => 0
[3,2,6,5,1,4] => 0
[3,2,6,5,4,1] => 0
[3,4,1,2,5,6] => 6
[3,4,1,2,6,5] => 7
[3,4,1,5,2,6] => 9
[3,4,1,5,6,2] => 9
[3,4,1,6,2,5] => 7
[3,4,1,6,5,2] => 8
[3,4,2,1,5,6] => 12
[3,4,2,1,6,5] => 11
[3,4,2,5,1,6] => 9
[3,4,2,5,6,1] => 9
[3,4,2,6,1,5] => 8
[3,4,2,6,5,1] => 8
[3,4,5,1,2,6] => 14
[3,4,5,1,6,2] => 16
[3,4,5,2,1,6] => 18
[3,4,5,2,6,1] => 16
[3,4,5,6,1,2] => 20
[3,4,5,6,2,1] => 22
[3,4,6,1,2,5] => 12
[3,4,6,1,5,2] => 13
[3,4,6,2,1,5] => 15
[3,4,6,2,5,1] => 13
[3,4,6,5,1,2] => 15
[3,4,6,5,2,1] => 14
[3,5,1,2,4,6] => 6
[3,5,1,2,6,4] => 7
[3,5,1,4,2,6] => 6
[3,5,1,4,6,2] => 6
[3,5,1,6,2,4] => 7
[3,5,1,6,4,2] => 8
[3,5,2,1,4,6] => 9
[3,5,2,1,6,4] => 11
[3,5,2,4,1,6] => 6
[3,5,2,4,6,1] => 6
[3,5,2,6,1,4] => 8
[3,5,2,6,4,1] => 8
[3,5,4,1,2,6] => 9
[3,5,4,1,6,2] => 11
[3,5,4,2,1,6] => 8
[3,5,4,2,6,1] => 10
[3,5,4,6,1,2] => 8
[3,5,4,6,2,1] => 8
[3,5,6,1,2,4] => 12
[3,5,6,1,4,2] => 13
[3,5,6,2,1,4] => 15
[3,5,6,2,4,1] => 13
[3,5,6,4,1,2] => 15
[3,5,6,4,2,1] => 14
[3,6,1,2,4,5] => 6
[3,6,1,2,5,4] => 6
[3,6,1,4,2,5] => 6
[3,6,1,4,5,2] => 6
[3,6,1,5,2,4] => 6
[3,6,1,5,4,2] => 6
[3,6,2,1,4,5] => 9
[3,6,2,1,5,4] => 8
[3,6,2,4,1,5] => 6
[3,6,2,4,5,1] => 6
[3,6,2,5,1,4] => 5
[3,6,2,5,4,1] => 6
[3,6,4,1,2,5] => 9
[3,6,4,1,5,2] => 11
[3,6,4,2,1,5] => 8
[3,6,4,2,5,1] => 10
[3,6,4,5,1,2] => 8
[3,6,4,5,2,1] => 8
[3,6,5,1,2,4] => 9
[3,6,5,1,4,2] => 8
[3,6,5,2,1,4] => 6
[3,6,5,2,4,1] => 8
[3,6,5,4,1,2] => 6
[3,6,5,4,2,1] => 8
[4,1,2,3,5,6] => 0
[4,1,2,3,6,5] => 0
[4,1,2,5,3,6] => 0
[4,1,2,5,6,3] => 0
[4,1,2,6,3,5] => 0
[4,1,2,6,5,3] => 0
[4,1,3,2,5,6] => 0
[4,1,3,2,6,5] => 0
[4,1,3,5,2,6] => 0
[4,1,3,5,6,2] => 0
[4,1,3,6,2,5] => 0
[4,1,3,6,5,2] => 0
[4,1,5,2,3,6] => 0
[4,1,5,2,6,3] => 0
[4,1,5,3,2,6] => 0
[4,1,5,3,6,2] => 0
[4,1,5,6,2,3] => 0
[4,1,5,6,3,2] => 0
[4,1,6,2,3,5] => 0
[4,1,6,2,5,3] => 0
[4,1,6,3,2,5] => 0
[4,1,6,3,5,2] => 0
[4,1,6,5,2,3] => 0
[4,1,6,5,3,2] => 0
[4,2,1,3,5,6] => 4
[4,2,1,3,6,5] => 4
[4,2,1,5,3,6] => 4
[4,2,1,5,6,3] => 4
[4,2,1,6,3,5] => 4
[4,2,1,6,5,3] => 5
[4,2,3,1,5,6] => 0
[4,2,3,1,6,5] => 0
[4,2,3,5,1,6] => 0
[4,2,3,5,6,1] => 0
[4,2,3,6,1,5] => 0
[4,2,3,6,5,1] => 0
[4,2,5,1,3,6] => 0
[4,2,5,1,6,3] => 0
[4,2,5,3,1,6] => 0
[4,2,5,3,6,1] => 0
[4,2,5,6,1,3] => 0
[4,2,5,6,3,1] => 0
[4,2,6,1,3,5] => 0
[4,2,6,1,5,3] => 0
[4,2,6,3,1,5] => 0
[4,2,6,3,5,1] => 0
[4,2,6,5,1,3] => 0
[4,2,6,5,3,1] => 0
[4,3,1,2,5,6] => 4
[4,3,1,2,6,5] => 4
[4,3,1,5,2,6] => 4
[4,3,1,5,6,2] => 4
[4,3,1,6,2,5] => 4
[4,3,1,6,5,2] => 5
[4,3,2,1,5,6] => 0
[4,3,2,1,6,5] => 0
[4,3,2,5,1,6] => 3
[4,3,2,5,6,1] => 3
[4,3,2,6,1,5] => 3
[4,3,2,6,5,1] => 3
[4,3,5,1,2,6] => 0
[4,3,5,1,6,2] => 0
[4,3,5,2,1,6] => 0
[4,3,5,2,6,1] => 0
[4,3,5,6,1,2] => 0
[4,3,5,6,2,1] => 0
[4,3,6,1,2,5] => 0
[4,3,6,1,5,2] => 0
[4,3,6,2,1,5] => 0
[4,3,6,2,5,1] => 0
[4,3,6,5,1,2] => 0
[4,3,6,5,2,1] => 0
[4,5,1,2,3,6] => 6
[4,5,1,2,6,3] => 7
[4,5,1,3,2,6] => 6
[4,5,1,3,6,2] => 6
[4,5,1,6,2,3] => 7
[4,5,1,6,3,2] => 8
[4,5,2,1,3,6] => 9
[4,5,2,1,6,3] => 11
[4,5,2,3,1,6] => 6
[4,5,2,3,6,1] => 6
[4,5,2,6,1,3] => 8
[4,5,2,6,3,1] => 8
[4,5,3,1,2,6] => 9
[4,5,3,1,6,2] => 11
[4,5,3,2,1,6] => 8
[4,5,3,2,6,1] => 10
[4,5,3,6,1,2] => 8
[4,5,3,6,2,1] => 8
[4,5,6,1,2,3] => 12
[4,5,6,1,3,2] => 13
[4,5,6,2,1,3] => 15
[4,5,6,2,3,1] => 13
[4,5,6,3,1,2] => 15
[4,5,6,3,2,1] => 14
[4,6,1,2,3,5] => 6
[4,6,1,2,5,3] => 6
[4,6,1,3,2,5] => 6
[4,6,1,3,5,2] => 6
[4,6,1,5,2,3] => 6
[4,6,1,5,3,2] => 6
[4,6,2,1,3,5] => 9
[4,6,2,1,5,3] => 8
[4,6,2,3,1,5] => 6
[4,6,2,3,5,1] => 6
[4,6,2,5,1,3] => 5
[4,6,2,5,3,1] => 6
[4,6,3,1,2,5] => 9
[4,6,3,1,5,2] => 8
[4,6,3,2,1,5] => 6
[4,6,3,2,5,1] => 8
[4,6,3,5,1,2] => 5
[4,6,3,5,2,1] => 6
[4,6,5,1,2,3] => 9
[4,6,5,1,3,2] => 8
[4,6,5,2,1,3] => 6
[4,6,5,2,3,1] => 8
[4,6,5,3,1,2] => 6
[4,6,5,3,2,1] => 8
[5,1,2,3,4,6] => 0
[5,1,2,3,6,4] => 0
[5,1,2,4,3,6] => 0
[5,1,2,4,6,3] => 0
[5,1,2,6,3,4] => 0
[5,1,2,6,4,3] => 0
[5,1,3,2,4,6] => 0
[5,1,3,2,6,4] => 0
[5,1,3,4,2,6] => 0
[5,1,3,4,6,2] => 0
[5,1,3,6,2,4] => 0
[5,1,3,6,4,2] => 0
[5,1,4,2,3,6] => 0
[5,1,4,2,6,3] => 0
[5,1,4,3,2,6] => 0
[5,1,4,3,6,2] => 0
[5,1,4,6,2,3] => 0
[5,1,4,6,3,2] => 0
[5,1,6,2,3,4] => 0
[5,1,6,2,4,3] => 0
[5,1,6,3,2,4] => 0
[5,1,6,3,4,2] => 0
[5,1,6,4,2,3] => 0
[5,1,6,4,3,2] => 0
[5,2,1,3,4,6] => 4
[5,2,1,3,6,4] => 4
[5,2,1,4,3,6] => 4
[5,2,1,4,6,3] => 4
[5,2,1,6,3,4] => 4
[5,2,1,6,4,3] => 5
[5,2,3,1,4,6] => 0
[5,2,3,1,6,4] => 0
[5,2,3,4,1,6] => 0
[5,2,3,4,6,1] => 0
[5,2,3,6,1,4] => 0
[5,2,3,6,4,1] => 0
[5,2,4,1,3,6] => 0
[5,2,4,1,6,3] => 0
[5,2,4,3,1,6] => 0
[5,2,4,3,6,1] => 0
[5,2,4,6,1,3] => 0
[5,2,4,6,3,1] => 0
[5,2,6,1,3,4] => 0
[5,2,6,1,4,3] => 0
[5,2,6,3,1,4] => 0
[5,2,6,3,4,1] => 0
[5,2,6,4,1,3] => 0
[5,2,6,4,3,1] => 0
[5,3,1,2,4,6] => 4
[5,3,1,2,6,4] => 4
[5,3,1,4,2,6] => 4
[5,3,1,4,6,2] => 4
[5,3,1,6,2,4] => 4
[5,3,1,6,4,2] => 5
[5,3,2,1,4,6] => 0
[5,3,2,1,6,4] => 0
[5,3,2,4,1,6] => 3
[5,3,2,4,6,1] => 3
[5,3,2,6,1,4] => 3
[5,3,2,6,4,1] => 3
[5,3,4,1,2,6] => 0
[5,3,4,1,6,2] => 0
[5,3,4,2,1,6] => 0
[5,3,4,2,6,1] => 0
[5,3,4,6,1,2] => 0
[5,3,4,6,2,1] => 0
[5,3,6,1,2,4] => 0
[5,3,6,1,4,2] => 0
[5,3,6,2,1,4] => 0
[5,3,6,2,4,1] => 0
[5,3,6,4,1,2] => 0
[5,3,6,4,2,1] => 0
[5,4,1,2,3,6] => 4
[5,4,1,2,6,3] => 4
[5,4,1,3,2,6] => 3
[5,4,1,3,6,2] => 3
[5,4,1,6,2,3] => 4
[5,4,1,6,3,2] => 3
[5,4,2,1,3,6] => 0
[5,4,2,1,6,3] => 0
[5,4,2,3,1,6] => 3
[5,4,2,3,6,1] => 3
[5,4,2,6,1,3] => 3
[5,4,2,6,3,1] => 3
[5,4,3,1,2,6] => 0
[5,4,3,1,6,2] => 0
[5,4,3,2,1,6] => 2
[5,4,3,2,6,1] => 0
[5,4,3,6,1,2] => 3
[5,4,3,6,2,1] => 2
[5,4,6,1,2,3] => 0
[5,4,6,1,3,2] => 0
[5,4,6,2,1,3] => 0
[5,4,6,2,3,1] => 0
[5,4,6,3,1,2] => 0
[5,4,6,3,2,1] => 0
[5,6,1,2,3,4] => 6
[5,6,1,2,4,3] => 6
[5,6,1,3,2,4] => 6
[5,6,1,3,4,2] => 6
[5,6,1,4,2,3] => 6
[5,6,1,4,3,2] => 6
[5,6,2,1,3,4] => 9
[5,6,2,1,4,3] => 8
[5,6,2,3,1,4] => 6
[5,6,2,3,4,1] => 6
[5,6,2,4,1,3] => 5
[5,6,2,4,3,1] => 6
[5,6,3,1,2,4] => 9
[5,6,3,1,4,2] => 8
[5,6,3,2,1,4] => 6
[5,6,3,2,4,1] => 8
[5,6,3,4,1,2] => 5
[5,6,3,4,2,1] => 6
[5,6,4,1,2,3] => 9
[5,6,4,1,3,2] => 8
[5,6,4,2,1,3] => 6
[5,6,4,2,3,1] => 8
[5,6,4,3,1,2] => 6
[5,6,4,3,2,1] => 8
[6,1,2,3,4,5] => 0
[6,1,2,3,5,4] => 0
[6,1,2,4,3,5] => 0
[6,1,2,4,5,3] => 0
[6,1,2,5,3,4] => 0
[6,1,2,5,4,3] => 0
[6,1,3,2,4,5] => 0
[6,1,3,2,5,4] => 0
[6,1,3,4,2,5] => 0
[6,1,3,4,5,2] => 0
[6,1,3,5,2,4] => 0
[6,1,3,5,4,2] => 0
[6,1,4,2,3,5] => 0
[6,1,4,2,5,3] => 0
[6,1,4,3,2,5] => 0
[6,1,4,3,5,2] => 0
[6,1,4,5,2,3] => 0
[6,1,4,5,3,2] => 0
[6,1,5,2,3,4] => 0
[6,1,5,2,4,3] => 0
[6,1,5,3,2,4] => 0
[6,1,5,3,4,2] => 0
[6,1,5,4,2,3] => 0
[6,1,5,4,3,2] => 0
[6,2,1,3,4,5] => 4
[6,2,1,3,5,4] => 4
[6,2,1,4,3,5] => 4
[6,2,1,4,5,3] => 4
[6,2,1,5,3,4] => 4
[6,2,1,5,4,3] => 3
[6,2,3,1,4,5] => 0
[6,2,3,1,5,4] => 0
[6,2,3,4,1,5] => 0
[6,2,3,4,5,1] => 0
[6,2,3,5,1,4] => 0
[6,2,3,5,4,1] => 0
[6,2,4,1,3,5] => 0
[6,2,4,1,5,3] => 0
[6,2,4,3,1,5] => 0
[6,2,4,3,5,1] => 0
[6,2,4,5,1,3] => 0
[6,2,4,5,3,1] => 0
[6,2,5,1,3,4] => 0
[6,2,5,1,4,3] => 0
[6,2,5,3,1,4] => 0
[6,2,5,3,4,1] => 0
[6,2,5,4,1,3] => 0
[6,2,5,4,3,1] => 0
[6,3,1,2,4,5] => 4
[6,3,1,2,5,4] => 4
[6,3,1,4,2,5] => 4
[6,3,1,4,5,2] => 4
[6,3,1,5,2,4] => 4
[6,3,1,5,4,2] => 3
[6,3,2,1,4,5] => 0
[6,3,2,1,5,4] => 0
[6,3,2,4,1,5] => 3
[6,3,2,4,5,1] => 3
[6,3,2,5,1,4] => 3
[6,3,2,5,4,1] => 3
[6,3,4,1,2,5] => 0
[6,3,4,1,5,2] => 0
[6,3,4,2,1,5] => 0
[6,3,4,2,5,1] => 0
[6,3,4,5,1,2] => 0
[6,3,4,5,2,1] => 0
[6,3,5,1,2,4] => 0
[6,3,5,1,4,2] => 0
[6,3,5,2,1,4] => 0
[6,3,5,2,4,1] => 0
[6,3,5,4,1,2] => 0
[6,3,5,4,2,1] => 0
[6,4,1,2,3,5] => 4
[6,4,1,2,5,3] => 4
[6,4,1,3,2,5] => 3
[6,4,1,3,5,2] => 3
[6,4,1,5,2,3] => 4
[6,4,1,5,3,2] => 3
[6,4,2,1,3,5] => 0
[6,4,2,1,5,3] => 0
[6,4,2,3,1,5] => 3
[6,4,2,3,5,1] => 3
[6,4,2,5,1,3] => 3
[6,4,2,5,3,1] => 3
[6,4,3,1,2,5] => 0
[6,4,3,1,5,2] => 0
[6,4,3,2,1,5] => 2
[6,4,3,2,5,1] => 0
[6,4,3,5,1,2] => 3
[6,4,3,5,2,1] => 2
[6,4,5,1,2,3] => 0
[6,4,5,1,3,2] => 0
[6,4,5,2,1,3] => 0
[6,4,5,2,3,1] => 0
[6,4,5,3,1,2] => 0
[6,4,5,3,2,1] => 0
[6,5,1,2,3,4] => 4
[6,5,1,2,4,3] => 3
[6,5,1,3,2,4] => 3
[6,5,1,3,4,2] => 3
[6,5,1,4,2,3] => 3
[6,5,1,4,3,2] => 2
[6,5,2,1,3,4] => 0
[6,5,2,1,4,3] => 0
[6,5,2,3,1,4] => 3
[6,5,2,3,4,1] => 3
[6,5,2,4,1,3] => 3
[6,5,2,4,3,1] => 2
[6,5,3,1,2,4] => 0
[6,5,3,1,4,2] => 0
[6,5,3,2,1,4] => 2
[6,5,3,2,4,1] => 0
[6,5,3,4,1,2] => 3
[6,5,3,4,2,1] => 2
[6,5,4,1,2,3] => 0
[6,5,4,1,3,2] => 0
[6,5,4,2,1,3] => 2
[6,5,4,2,3,1] => 0
[6,5,4,3,1,2] => 2
[6,5,4,3,2,1] => 0
click to show generating function       
Description
Eigenvalues of the random-to-random operator acting on the regular representation.
This statistic is defined for a permutation $w$ as:
$$ \left[\binom{\ell(w) + 1}{2} + \operatorname{diag}\left(Q(w)\right)\right] - \left[\binom{\ell(u) + 1}{2} + \operatorname{diag}\left(Q(u)\right)\right] $$
where:
  • $u$ is the longest suffix of $w$ (viewed as a word) whose first ascent is even;
  • $\ell(w)$ is the size of the permutation $w$ (equivalently, the length of the word $w$);
  • $Q(w), Q(u)$ denote the recording tableaux of $w, u$ under the RSK correspondence;
  • $\operatorname{diag}(\lambda)$ denotes the diagonal index (or content) of an integer partition $\lambda$;
  • and $\operatorname{diag}(T)$ of a tableau $T$ denotes the diagonal index of the partition given by the shape of $T$.
The regular representation of the symmetric group of degree n has dimension n!, so any linear operator acting on this vector space has n! eigenvalues (counting multiplicities). Hence, the eigenvalues of the random-to-random operator can be indexed by permutations; and the values of this statistic give all the eigenvalues of the operator (Theorem 12 of [1]).
References
[1] Dieker, A. B., Saliola, F. Spectral analysis of random-to-random Markov chains arXiv:1509.08580
Code
def is_desarrangement_word(w):
    r"""
    EXAMPLES::

        sage: for n in range(4):
        ....:     for perm in Permutations(n):
        ....:         print "%s => %s" % (perm, is_desarrangement_word(perm))
        [] => True
        [1] => False
        [1, 2] => False
        [2, 1] => True
        [1, 2, 3] => False
        [1, 3, 2] => False
        [2, 1, 3] => True
        [2, 3, 1] => False
        [3, 1, 2] => True
        [3, 2, 1] => False
    """
    X = [k for k in range(len(w)-1) if w[k] <= w[k+1]]
    if X:
        return X[0] % 2 == 1
    else:
        return len(w) % 2 == 0

def desarrangement_factorization(w):
    r"""
    EXAMPLES::

        sage: for n in range(4):
        ....:     for perm in Permutations(n):
        ....:         print "%s => %s" % (perm, desarrangement_factorization(perm))
        [] => ([], [])
        [1] => ([1], [])
        [1, 2] => ([1, 2], [])
        [2, 1] => ([], [2, 1])
        [1, 2, 3] => ([1, 2, 3], [])
        [1, 3, 2] => ([1], [3, 2])
        [2, 1, 3] => ([], [2, 1, 3])
        [2, 3, 1] => ([2], [3, 1])
        [3, 1, 2] => ([], [3, 1, 2])
        [3, 2, 1] => ([3], [2, 1])
    """
    for i in range(len(w) + 1):
        u = Word(w[i:]).standard_permutation()
        if is_desarrangement_word(u):
            return w[:i], w[i:]

def diagonal_index_of_partition(la):
    return sum((j - i) for (i, j) in la.cells())

def binomial_shifted_diagonal_index_of_partition(partition):
    return binomial(partition.size() + 1, 2) + diagonal_index_of_partition(partition)

def statistic(w):
    r"""
    EXAMPLES::

        sage: for n in range(5):
        ....:     for perm in Permutations(n):
        ....:         print "%s => %s" % (perm, statistic(perm))
        [] => 0
        [1] => 1
        [1, 2] => 4
        [2, 1] => 0
        [1, 2, 3] => 9
        [1, 3, 2] => 4
        [2, 1, 3] => 0
        [2, 3, 1] => 4
        [3, 1, 2] => 0
        [3, 2, 1] => 1
    """
    Qw = RSK(w)[1]
    _, u = desarrangement_factorization(w)
    Qu = RSK(u)[1]
    Qw_index = binomial_shifted_diagonal_index_of_partition(Qw.shape())
    Qu_index = binomial_shifted_diagonal_index_of_partition(Qu.shape())
    return Qw_index - Qu_index

Created
May 23, 2016 at 21:58 by Franco Saliola
Updated
Jan 13, 2018 at 15:45 by Martin Rubey