Identifier
Identifier
Values
[1,2] => 1
[2,1] => 1
[1,2,3] => 1
[1,3,2] => 2
[2,1,3] => 2
[2,3,1] => 2
[3,1,2] => 2
[3,2,1] => 1
[1,2,3,4] => 1
[1,2,4,3] => 3
[1,3,2,4] => 5
[1,3,4,2] => 3
[1,4,2,3] => 5
[1,4,3,2] => 3
[2,1,3,4] => 3
[2,1,4,3] => 5
[2,3,1,4] => 5
[2,3,4,1] => 3
[2,4,1,3] => 5
[2,4,3,1] => 3
[3,1,2,4] => 3
[3,1,4,2] => 5
[3,2,1,4] => 3
[3,2,4,1] => 5
[3,4,1,2] => 5
[3,4,2,1] => 3
[4,1,2,3] => 3
[4,1,3,2] => 5
[4,2,1,3] => 3
[4,2,3,1] => 5
[4,3,1,2] => 3
[4,3,2,1] => 1
[1,2,3,4,5] => 1
[1,2,3,5,4] => 4
[1,2,4,3,5] => 9
[1,2,4,5,3] => 4
[1,2,5,3,4] => 9
[1,2,5,4,3] => 6
[1,3,2,4,5] => 9
[1,3,2,5,4] => 16
[1,3,4,2,5] => 9
[1,3,4,5,2] => 4
[1,3,5,2,4] => 9
[1,3,5,4,2] => 6
[1,4,2,3,5] => 9
[1,4,2,5,3] => 16
[1,4,3,2,5] => 11
[1,4,3,5,2] => 16
[1,4,5,2,3] => 9
[1,4,5,3,2] => 6
[1,5,2,3,4] => 9
[1,5,2,4,3] => 16
[1,5,3,2,4] => 11
[1,5,3,4,2] => 16
[1,5,4,2,3] => 11
[1,5,4,3,2] => 4
[2,1,3,4,5] => 4
[2,1,3,5,4] => 11
[2,1,4,3,5] => 16
[2,1,4,5,3] => 11
[2,1,5,3,4] => 16
[2,1,5,4,3] => 9
[2,3,1,4,5] => 9
[2,3,1,5,4] => 16
[2,3,4,1,5] => 9
[2,3,4,5,1] => 4
[2,3,5,1,4] => 9
[2,3,5,4,1] => 6
[2,4,1,3,5] => 9
[2,4,1,5,3] => 16
[2,4,3,1,5] => 11
[2,4,3,5,1] => 16
[2,4,5,1,3] => 9
[2,4,5,3,1] => 6
[2,5,1,3,4] => 9
[2,5,1,4,3] => 16
[2,5,3,1,4] => 11
[2,5,3,4,1] => 16
[2,5,4,1,3] => 11
[2,5,4,3,1] => 4
[3,1,2,4,5] => 4
[3,1,2,5,4] => 11
[3,1,4,2,5] => 16
[3,1,4,5,2] => 11
[3,1,5,2,4] => 16
[3,1,5,4,2] => 9
[3,2,1,4,5] => 6
[3,2,1,5,4] => 9
[3,2,4,1,5] => 16
[3,2,4,5,1] => 11
[3,2,5,1,4] => 16
[3,2,5,4,1] => 9
[3,4,1,2,5] => 9
[3,4,1,5,2] => 16
[3,4,2,1,5] => 11
[3,4,2,5,1] => 16
[3,4,5,1,2] => 9
[3,4,5,2,1] => 6
[3,5,1,2,4] => 9
[3,5,1,4,2] => 16
[3,5,2,1,4] => 11
[3,5,2,4,1] => 16
[3,5,4,1,2] => 11
[3,5,4,2,1] => 4
[4,1,2,3,5] => 4
[4,1,2,5,3] => 11
[4,1,3,2,5] => 16
[4,1,3,5,2] => 11
[4,1,5,2,3] => 16
[4,1,5,3,2] => 9
[4,2,1,3,5] => 6
[4,2,1,5,3] => 9
[4,2,3,1,5] => 16
[4,2,3,5,1] => 11
[4,2,5,1,3] => 16
[4,2,5,3,1] => 9
[4,3,1,2,5] => 6
[4,3,1,5,2] => 9
[4,3,2,1,5] => 4
[4,3,2,5,1] => 9
[4,3,5,1,2] => 16
[4,3,5,2,1] => 9
[4,5,1,2,3] => 9
[4,5,1,3,2] => 16
[4,5,2,1,3] => 11
[4,5,2,3,1] => 16
[4,5,3,1,2] => 11
[4,5,3,2,1] => 4
[5,1,2,3,4] => 4
[5,1,2,4,3] => 11
[5,1,3,2,4] => 16
[5,1,3,4,2] => 11
[5,1,4,2,3] => 16
[5,1,4,3,2] => 9
[5,2,1,3,4] => 6
[5,2,1,4,3] => 9
[5,2,3,1,4] => 16
[5,2,3,4,1] => 11
[5,2,4,1,3] => 16
[5,2,4,3,1] => 9
[5,3,1,2,4] => 6
[5,3,1,4,2] => 9
[5,3,2,1,4] => 4
[5,3,2,4,1] => 9
[5,3,4,1,2] => 16
[5,3,4,2,1] => 9
[5,4,1,2,3] => 6
[5,4,1,3,2] => 9
[5,4,2,1,3] => 4
[5,4,2,3,1] => 9
[5,4,3,1,2] => 4
[5,4,3,2,1] => 1
[1,2,3,4,5,6] => 1
[1,2,3,4,6,5] => 5
[1,2,3,5,4,6] => 14
[1,2,3,5,6,4] => 5
[1,2,3,6,4,5] => 14
[1,2,3,6,5,4] => 10
[1,2,4,3,5,6] => 19
[1,2,4,3,6,5] => 35
[1,2,4,5,3,6] => 14
[1,2,4,5,6,3] => 5
[1,2,4,6,3,5] => 14
[1,2,4,6,5,3] => 10
[1,2,5,3,4,6] => 19
[1,2,5,3,6,4] => 35
[1,2,5,4,3,6] => 26
[1,2,5,4,6,3] => 35
[1,2,5,6,3,4] => 14
[1,2,5,6,4,3] => 10
[1,2,6,3,4,5] => 19
[1,2,6,3,5,4] => 35
[1,2,6,4,3,5] => 26
[1,2,6,4,5,3] => 35
[1,2,6,5,3,4] => 26
[1,2,6,5,4,3] => 10
[1,3,2,4,5,6] => 14
[1,3,2,4,6,5] => 40
[1,3,2,5,4,6] => 61
[1,3,2,5,6,4] => 40
[1,3,2,6,4,5] => 61
[1,3,2,6,5,4] => 35
[1,3,4,2,5,6] => 19
[1,3,4,2,6,5] => 35
[1,3,4,5,2,6] => 14
[1,3,4,5,6,2] => 5
[1,3,4,6,2,5] => 14
[1,3,4,6,5,2] => 10
[1,3,5,2,4,6] => 19
[1,3,5,2,6,4] => 35
[1,3,5,4,2,6] => 26
[1,3,5,4,6,2] => 35
[1,3,5,6,2,4] => 14
[1,3,5,6,4,2] => 10
[1,3,6,2,4,5] => 19
[1,3,6,2,5,4] => 35
[1,3,6,4,2,5] => 26
[1,3,6,4,5,2] => 35
[1,3,6,5,2,4] => 26
[1,3,6,5,4,2] => 10
[1,4,2,3,5,6] => 14
[1,4,2,3,6,5] => 40
[1,4,2,5,3,6] => 61
[1,4,2,5,6,3] => 40
[1,4,2,6,3,5] => 61
[1,4,2,6,5,3] => 35
[1,4,3,2,5,6] => 26
[1,4,3,2,6,5] => 40
[1,4,3,5,2,6] => 61
[1,4,3,5,6,2] => 40
[1,4,3,6,2,5] => 61
[1,4,3,6,5,2] => 35
[1,4,5,2,3,6] => 19
[1,4,5,2,6,3] => 35
[1,4,5,3,2,6] => 26
[1,4,5,3,6,2] => 35
[1,4,5,6,2,3] => 14
[1,4,5,6,3,2] => 10
[1,4,6,2,3,5] => 19
[1,4,6,2,5,3] => 35
[1,4,6,3,2,5] => 26
[1,4,6,3,5,2] => 35
[1,4,6,5,2,3] => 26
[1,4,6,5,3,2] => 10
[1,5,2,3,4,6] => 14
[1,5,2,3,6,4] => 40
[1,5,2,4,3,6] => 61
[1,5,2,4,6,3] => 40
[1,5,2,6,3,4] => 61
[1,5,2,6,4,3] => 35
[1,5,3,2,4,6] => 26
[1,5,3,2,6,4] => 40
[1,5,3,4,2,6] => 61
[1,5,3,4,6,2] => 40
[1,5,3,6,2,4] => 61
[1,5,3,6,4,2] => 35
[1,5,4,2,3,6] => 26
[1,5,4,2,6,3] => 40
[1,5,4,3,2,6] => 19
[1,5,4,3,6,2] => 40
[1,5,4,6,2,3] => 61
[1,5,4,6,3,2] => 35
[1,5,6,2,3,4] => 19
[1,5,6,2,4,3] => 35
[1,5,6,3,2,4] => 26
[1,5,6,3,4,2] => 35
[1,5,6,4,2,3] => 26
[1,5,6,4,3,2] => 10
[1,6,2,3,4,5] => 14
[1,6,2,3,5,4] => 40
[1,6,2,4,3,5] => 61
[1,6,2,4,5,3] => 40
[1,6,2,5,3,4] => 61
[1,6,2,5,4,3] => 35
[1,6,3,2,4,5] => 26
[1,6,3,2,5,4] => 40
[1,6,3,4,2,5] => 61
[1,6,3,4,5,2] => 40
[1,6,3,5,2,4] => 61
[1,6,3,5,4,2] => 35
[1,6,4,2,3,5] => 26
[1,6,4,2,5,3] => 40
[1,6,4,3,2,5] => 19
[1,6,4,3,5,2] => 40
[1,6,4,5,2,3] => 61
[1,6,4,5,3,2] => 35
[1,6,5,2,3,4] => 26
[1,6,5,2,4,3] => 40
[1,6,5,3,2,4] => 19
[1,6,5,3,4,2] => 40
[1,6,5,4,2,3] => 19
[1,6,5,4,3,2] => 5
[2,1,3,4,5,6] => 5
[2,1,3,4,6,5] => 19
[2,1,3,5,4,6] => 40
[2,1,3,5,6,4] => 19
[2,1,3,6,4,5] => 40
[2,1,3,6,5,4] => 26
[2,1,4,3,5,6] => 35
[2,1,4,3,6,5] => 61
[2,1,4,5,3,6] => 40
[2,1,4,5,6,3] => 19
[2,1,4,6,3,5] => 40
[2,1,4,6,5,3] => 26
[2,1,5,3,4,6] => 35
[2,1,5,3,6,4] => 61
[2,1,5,4,3,6] => 40
[2,1,5,4,6,3] => 61
[2,1,5,6,3,4] => 40
[2,1,5,6,4,3] => 26
[2,1,6,3,4,5] => 35
[2,1,6,3,5,4] => 61
[2,1,6,4,3,5] => 40
[2,1,6,4,5,3] => 61
[2,1,6,5,3,4] => 40
[2,1,6,5,4,3] => 14
[2,3,1,4,5,6] => 14
[2,3,1,4,6,5] => 40
[2,3,1,5,4,6] => 61
[2,3,1,5,6,4] => 40
[2,3,1,6,4,5] => 61
[2,3,1,6,5,4] => 35
[2,3,4,1,5,6] => 19
[2,3,4,1,6,5] => 35
[2,3,4,5,1,6] => 14
[2,3,4,5,6,1] => 5
[2,3,4,6,1,5] => 14
[2,3,4,6,5,1] => 10
[2,3,5,1,4,6] => 19
[2,3,5,1,6,4] => 35
[2,3,5,4,1,6] => 26
[2,3,5,4,6,1] => 35
[2,3,5,6,1,4] => 14
[2,3,5,6,4,1] => 10
[2,3,6,1,4,5] => 19
[2,3,6,1,5,4] => 35
[2,3,6,4,1,5] => 26
[2,3,6,4,5,1] => 35
[2,3,6,5,1,4] => 26
[2,3,6,5,4,1] => 10
[2,4,1,3,5,6] => 14
[2,4,1,3,6,5] => 40
[2,4,1,5,3,6] => 61
[2,4,1,5,6,3] => 40
[2,4,1,6,3,5] => 61
[2,4,1,6,5,3] => 35
[2,4,3,1,5,6] => 26
[2,4,3,1,6,5] => 40
[2,4,3,5,1,6] => 61
[2,4,3,5,6,1] => 40
[2,4,3,6,1,5] => 61
[2,4,3,6,5,1] => 35
[2,4,5,1,3,6] => 19
[2,4,5,1,6,3] => 35
[2,4,5,3,1,6] => 26
[2,4,5,3,6,1] => 35
[2,4,5,6,1,3] => 14
[2,4,5,6,3,1] => 10
[2,4,6,1,3,5] => 19
[2,4,6,1,5,3] => 35
[2,4,6,3,1,5] => 26
[2,4,6,3,5,1] => 35
[2,4,6,5,1,3] => 26
[2,4,6,5,3,1] => 10
[2,5,1,3,4,6] => 14
[2,5,1,3,6,4] => 40
[2,5,1,4,3,6] => 61
[2,5,1,4,6,3] => 40
[2,5,1,6,3,4] => 61
[2,5,1,6,4,3] => 35
[2,5,3,1,4,6] => 26
[2,5,3,1,6,4] => 40
[2,5,3,4,1,6] => 61
[2,5,3,4,6,1] => 40
[2,5,3,6,1,4] => 61
[2,5,3,6,4,1] => 35
[2,5,4,1,3,6] => 26
[2,5,4,1,6,3] => 40
[2,5,4,3,1,6] => 19
[2,5,4,3,6,1] => 40
[2,5,4,6,1,3] => 61
[2,5,4,6,3,1] => 35
[2,5,6,1,3,4] => 19
[2,5,6,1,4,3] => 35
[2,5,6,3,1,4] => 26
[2,5,6,3,4,1] => 35
[2,5,6,4,1,3] => 26
[2,5,6,4,3,1] => 10
[2,6,1,3,4,5] => 14
[2,6,1,3,5,4] => 40
[2,6,1,4,3,5] => 61
[2,6,1,4,5,3] => 40
[2,6,1,5,3,4] => 61
[2,6,1,5,4,3] => 35
[2,6,3,1,4,5] => 26
[2,6,3,1,5,4] => 40
[2,6,3,4,1,5] => 61
[2,6,3,4,5,1] => 40
[2,6,3,5,1,4] => 61
[2,6,3,5,4,1] => 35
[2,6,4,1,3,5] => 26
[2,6,4,1,5,3] => 40
[2,6,4,3,1,5] => 19
[2,6,4,3,5,1] => 40
[2,6,4,5,1,3] => 61
[2,6,4,5,3,1] => 35
[2,6,5,1,3,4] => 26
[2,6,5,1,4,3] => 40
[2,6,5,3,1,4] => 19
[2,6,5,3,4,1] => 40
[2,6,5,4,1,3] => 19
[2,6,5,4,3,1] => 5
[3,1,2,4,5,6] => 5
[3,1,2,4,6,5] => 19
[3,1,2,5,4,6] => 40
[3,1,2,5,6,4] => 19
[3,1,2,6,4,5] => 40
[3,1,2,6,5,4] => 26
[3,1,4,2,5,6] => 35
[3,1,4,2,6,5] => 61
[3,1,4,5,2,6] => 40
[3,1,4,5,6,2] => 19
[3,1,4,6,2,5] => 40
[3,1,4,6,5,2] => 26
[3,1,5,2,4,6] => 35
[3,1,5,2,6,4] => 61
[3,1,5,4,2,6] => 40
[3,1,5,4,6,2] => 61
[3,1,5,6,2,4] => 40
[3,1,5,6,4,2] => 26
[3,1,6,2,4,5] => 35
[3,1,6,2,5,4] => 61
[3,1,6,4,2,5] => 40
[3,1,6,4,5,2] => 61
[3,1,6,5,2,4] => 40
[3,1,6,5,4,2] => 14
[3,2,1,4,5,6] => 10
[3,2,1,4,6,5] => 26
[3,2,1,5,4,6] => 35
[3,2,1,5,6,4] => 26
[3,2,1,6,4,5] => 35
[3,2,1,6,5,4] => 19
[3,2,4,1,5,6] => 35
[3,2,4,1,6,5] => 61
[3,2,4,5,1,6] => 40
[3,2,4,5,6,1] => 19
[3,2,4,6,1,5] => 40
[3,2,4,6,5,1] => 26
[3,2,5,1,4,6] => 35
[3,2,5,1,6,4] => 61
[3,2,5,4,1,6] => 40
[3,2,5,4,6,1] => 61
[3,2,5,6,1,4] => 40
[3,2,5,6,4,1] => 26
[3,2,6,1,4,5] => 35
[3,2,6,1,5,4] => 61
[3,2,6,4,1,5] => 40
[3,2,6,4,5,1] => 61
[3,2,6,5,1,4] => 40
[3,2,6,5,4,1] => 14
[3,4,1,2,5,6] => 14
[3,4,1,2,6,5] => 40
[3,4,1,5,2,6] => 61
[3,4,1,5,6,2] => 40
[3,4,1,6,2,5] => 61
[3,4,1,6,5,2] => 35
[3,4,2,1,5,6] => 26
[3,4,2,1,6,5] => 40
[3,4,2,5,1,6] => 61
[3,4,2,5,6,1] => 40
[3,4,2,6,1,5] => 61
[3,4,2,6,5,1] => 35
[3,4,5,1,2,6] => 19
[3,4,5,1,6,2] => 35
[3,4,5,2,1,6] => 26
[3,4,5,2,6,1] => 35
[3,4,5,6,1,2] => 14
[3,4,5,6,2,1] => 10
[3,4,6,1,2,5] => 19
[3,4,6,1,5,2] => 35
[3,4,6,2,1,5] => 26
[3,4,6,2,5,1] => 35
[3,4,6,5,1,2] => 26
[3,4,6,5,2,1] => 10
[3,5,1,2,4,6] => 14
[3,5,1,2,6,4] => 40
[3,5,1,4,2,6] => 61
[3,5,1,4,6,2] => 40
[3,5,1,6,2,4] => 61
[3,5,1,6,4,2] => 35
[3,5,2,1,4,6] => 26
[3,5,2,1,6,4] => 40
[3,5,2,4,1,6] => 61
[3,5,2,4,6,1] => 40
[3,5,2,6,1,4] => 61
[3,5,2,6,4,1] => 35
[3,5,4,1,2,6] => 26
[3,5,4,1,6,2] => 40
[3,5,4,2,1,6] => 19
[3,5,4,2,6,1] => 40
[3,5,4,6,1,2] => 61
[3,5,4,6,2,1] => 35
[3,5,6,1,2,4] => 19
[3,5,6,1,4,2] => 35
[3,5,6,2,1,4] => 26
[3,5,6,2,4,1] => 35
[3,5,6,4,1,2] => 26
[3,5,6,4,2,1] => 10
[3,6,1,2,4,5] => 14
[3,6,1,2,5,4] => 40
[3,6,1,4,2,5] => 61
[3,6,1,4,5,2] => 40
[3,6,1,5,2,4] => 61
[3,6,1,5,4,2] => 35
[3,6,2,1,4,5] => 26
[3,6,2,1,5,4] => 40
[3,6,2,4,1,5] => 61
[3,6,2,4,5,1] => 40
[3,6,2,5,1,4] => 61
[3,6,2,5,4,1] => 35
[3,6,4,1,2,5] => 26
[3,6,4,1,5,2] => 40
[3,6,4,2,1,5] => 19
[3,6,4,2,5,1] => 40
[3,6,4,5,1,2] => 61
[3,6,4,5,2,1] => 35
[3,6,5,1,2,4] => 26
[3,6,5,1,4,2] => 40
[3,6,5,2,1,4] => 19
[3,6,5,2,4,1] => 40
[3,6,5,4,1,2] => 19
[3,6,5,4,2,1] => 5
[4,1,2,3,5,6] => 5
[4,1,2,3,6,5] => 19
[4,1,2,5,3,6] => 40
[4,1,2,5,6,3] => 19
[4,1,2,6,3,5] => 40
[4,1,2,6,5,3] => 26
[4,1,3,2,5,6] => 35
[4,1,3,2,6,5] => 61
[4,1,3,5,2,6] => 40
[4,1,3,5,6,2] => 19
[4,1,3,6,2,5] => 40
[4,1,3,6,5,2] => 26
[4,1,5,2,3,6] => 35
[4,1,5,2,6,3] => 61
[4,1,5,3,2,6] => 40
[4,1,5,3,6,2] => 61
[4,1,5,6,2,3] => 40
[4,1,5,6,3,2] => 26
[4,1,6,2,3,5] => 35
[4,1,6,2,5,3] => 61
[4,1,6,3,2,5] => 40
[4,1,6,3,5,2] => 61
[4,1,6,5,2,3] => 40
[4,1,6,5,3,2] => 14
[4,2,1,3,5,6] => 10
[4,2,1,3,6,5] => 26
[4,2,1,5,3,6] => 35
[4,2,1,5,6,3] => 26
[4,2,1,6,3,5] => 35
[4,2,1,6,5,3] => 19
[4,2,3,1,5,6] => 35
[4,2,3,1,6,5] => 61
[4,2,3,5,1,6] => 40
[4,2,3,5,6,1] => 19
[4,2,3,6,1,5] => 40
[4,2,3,6,5,1] => 26
[4,2,5,1,3,6] => 35
[4,2,5,1,6,3] => 61
[4,2,5,3,1,6] => 40
[4,2,5,3,6,1] => 61
[4,2,5,6,1,3] => 40
[4,2,5,6,3,1] => 26
[4,2,6,1,3,5] => 35
[4,2,6,1,5,3] => 61
[4,2,6,3,1,5] => 40
[4,2,6,3,5,1] => 61
[4,2,6,5,1,3] => 40
[4,2,6,5,3,1] => 14
[4,3,1,2,5,6] => 10
[4,3,1,2,6,5] => 26
[4,3,1,5,2,6] => 35
[4,3,1,5,6,2] => 26
[4,3,1,6,2,5] => 35
[4,3,1,6,5,2] => 19
[4,3,2,1,5,6] => 10
[4,3,2,1,6,5] => 14
[4,3,2,5,1,6] => 35
[4,3,2,5,6,1] => 26
[4,3,2,6,1,5] => 35
[4,3,2,6,5,1] => 19
[4,3,5,1,2,6] => 35
[4,3,5,1,6,2] => 61
[4,3,5,2,1,6] => 40
[4,3,5,2,6,1] => 61
[4,3,5,6,1,2] => 40
[4,3,5,6,2,1] => 26
[4,3,6,1,2,5] => 35
[4,3,6,1,5,2] => 61
[4,3,6,2,1,5] => 40
[4,3,6,2,5,1] => 61
[4,3,6,5,1,2] => 40
[4,3,6,5,2,1] => 14
[4,5,1,2,3,6] => 14
[4,5,1,2,6,3] => 40
[4,5,1,3,2,6] => 61
[4,5,1,3,6,2] => 40
[4,5,1,6,2,3] => 61
[4,5,1,6,3,2] => 35
[4,5,2,1,3,6] => 26
[4,5,2,1,6,3] => 40
[4,5,2,3,1,6] => 61
[4,5,2,3,6,1] => 40
[4,5,2,6,1,3] => 61
[4,5,2,6,3,1] => 35
[4,5,3,1,2,6] => 26
[4,5,3,1,6,2] => 40
[4,5,3,2,1,6] => 19
[4,5,3,2,6,1] => 40
[4,5,3,6,1,2] => 61
[4,5,3,6,2,1] => 35
[4,5,6,1,2,3] => 19
[4,5,6,1,3,2] => 35
[4,5,6,2,1,3] => 26
[4,5,6,2,3,1] => 35
[4,5,6,3,1,2] => 26
[4,5,6,3,2,1] => 10
[4,6,1,2,3,5] => 14
[4,6,1,2,5,3] => 40
[4,6,1,3,2,5] => 61
[4,6,1,3,5,2] => 40
[4,6,1,5,2,3] => 61
[4,6,1,5,3,2] => 35
[4,6,2,1,3,5] => 26
[4,6,2,1,5,3] => 40
[4,6,2,3,1,5] => 61
[4,6,2,3,5,1] => 40
[4,6,2,5,1,3] => 61
[4,6,2,5,3,1] => 35
[4,6,3,1,2,5] => 26
[4,6,3,1,5,2] => 40
[4,6,3,2,1,5] => 19
[4,6,3,2,5,1] => 40
[4,6,3,5,1,2] => 61
[4,6,3,5,2,1] => 35
[4,6,5,1,2,3] => 26
[4,6,5,1,3,2] => 40
[4,6,5,2,1,3] => 19
[4,6,5,2,3,1] => 40
[4,6,5,3,1,2] => 19
[4,6,5,3,2,1] => 5
[5,1,2,3,4,6] => 5
[5,1,2,3,6,4] => 19
[5,1,2,4,3,6] => 40
[5,1,2,4,6,3] => 19
[5,1,2,6,3,4] => 40
[5,1,2,6,4,3] => 26
[5,1,3,2,4,6] => 35
[5,1,3,2,6,4] => 61
[5,1,3,4,2,6] => 40
[5,1,3,4,6,2] => 19
[5,1,3,6,2,4] => 40
[5,1,3,6,4,2] => 26
[5,1,4,2,3,6] => 35
[5,1,4,2,6,3] => 61
[5,1,4,3,2,6] => 40
[5,1,4,3,6,2] => 61
[5,1,4,6,2,3] => 40
[5,1,4,6,3,2] => 26
[5,1,6,2,3,4] => 35
[5,1,6,2,4,3] => 61
[5,1,6,3,2,4] => 40
[5,1,6,3,4,2] => 61
[5,1,6,4,2,3] => 40
[5,1,6,4,3,2] => 14
[5,2,1,3,4,6] => 10
[5,2,1,3,6,4] => 26
[5,2,1,4,3,6] => 35
[5,2,1,4,6,3] => 26
[5,2,1,6,3,4] => 35
[5,2,1,6,4,3] => 19
[5,2,3,1,4,6] => 35
[5,2,3,1,6,4] => 61
[5,2,3,4,1,6] => 40
[5,2,3,4,6,1] => 19
[5,2,3,6,1,4] => 40
[5,2,3,6,4,1] => 26
[5,2,4,1,3,6] => 35
[5,2,4,1,6,3] => 61
[5,2,4,3,1,6] => 40
[5,2,4,3,6,1] => 61
[5,2,4,6,1,3] => 40
[5,2,4,6,3,1] => 26
[5,2,6,1,3,4] => 35
[5,2,6,1,4,3] => 61
[5,2,6,3,1,4] => 40
[5,2,6,3,4,1] => 61
[5,2,6,4,1,3] => 40
[5,2,6,4,3,1] => 14
[5,3,1,2,4,6] => 10
[5,3,1,2,6,4] => 26
[5,3,1,4,2,6] => 35
[5,3,1,4,6,2] => 26
[5,3,1,6,2,4] => 35
[5,3,1,6,4,2] => 19
[5,3,2,1,4,6] => 10
[5,3,2,1,6,4] => 14
[5,3,2,4,1,6] => 35
[5,3,2,4,6,1] => 26
[5,3,2,6,1,4] => 35
[5,3,2,6,4,1] => 19
[5,3,4,1,2,6] => 35
[5,3,4,1,6,2] => 61
[5,3,4,2,1,6] => 40
[5,3,4,2,6,1] => 61
[5,3,4,6,1,2] => 40
[5,3,4,6,2,1] => 26
[5,3,6,1,2,4] => 35
[5,3,6,1,4,2] => 61
[5,3,6,2,1,4] => 40
[5,3,6,2,4,1] => 61
[5,3,6,4,1,2] => 40
[5,3,6,4,2,1] => 14
[5,4,1,2,3,6] => 10
[5,4,1,2,6,3] => 26
[5,4,1,3,2,6] => 35
[5,4,1,3,6,2] => 26
[5,4,1,6,2,3] => 35
[5,4,1,6,3,2] => 19
[5,4,2,1,3,6] => 10
[5,4,2,1,6,3] => 14
[5,4,2,3,1,6] => 35
[5,4,2,3,6,1] => 26
[5,4,2,6,1,3] => 35
[5,4,2,6,3,1] => 19
[5,4,3,1,2,6] => 10
[5,4,3,1,6,2] => 14
[5,4,3,2,1,6] => 5
[5,4,3,2,6,1] => 14
[5,4,3,6,1,2] => 35
[5,4,3,6,2,1] => 19
[5,4,6,1,2,3] => 35
[5,4,6,1,3,2] => 61
[5,4,6,2,1,3] => 40
[5,4,6,2,3,1] => 61
[5,4,6,3,1,2] => 40
[5,4,6,3,2,1] => 14
[5,6,1,2,3,4] => 14
[5,6,1,2,4,3] => 40
[5,6,1,3,2,4] => 61
[5,6,1,3,4,2] => 40
[5,6,1,4,2,3] => 61
[5,6,1,4,3,2] => 35
[5,6,2,1,3,4] => 26
[5,6,2,1,4,3] => 40
[5,6,2,3,1,4] => 61
[5,6,2,3,4,1] => 40
[5,6,2,4,1,3] => 61
[5,6,2,4,3,1] => 35
[5,6,3,1,2,4] => 26
[5,6,3,1,4,2] => 40
[5,6,3,2,1,4] => 19
[5,6,3,2,4,1] => 40
[5,6,3,4,1,2] => 61
[5,6,3,4,2,1] => 35
[5,6,4,1,2,3] => 26
[5,6,4,1,3,2] => 40
[5,6,4,2,1,3] => 19
[5,6,4,2,3,1] => 40
[5,6,4,3,1,2] => 19
[5,6,4,3,2,1] => 5
[6,1,2,3,4,5] => 5
[6,1,2,3,5,4] => 19
[6,1,2,4,3,5] => 40
[6,1,2,4,5,3] => 19
[6,1,2,5,3,4] => 40
[6,1,2,5,4,3] => 26
[6,1,3,2,4,5] => 35
[6,1,3,2,5,4] => 61
[6,1,3,4,2,5] => 40
[6,1,3,4,5,2] => 19
[6,1,3,5,2,4] => 40
[6,1,3,5,4,2] => 26
[6,1,4,2,3,5] => 35
[6,1,4,2,5,3] => 61
[6,1,4,3,2,5] => 40
[6,1,4,3,5,2] => 61
[6,1,4,5,2,3] => 40
[6,1,4,5,3,2] => 26
[6,1,5,2,3,4] => 35
[6,1,5,2,4,3] => 61
[6,1,5,3,2,4] => 40
[6,1,5,3,4,2] => 61
[6,1,5,4,2,3] => 40
[6,1,5,4,3,2] => 14
[6,2,1,3,4,5] => 10
[6,2,1,3,5,4] => 26
[6,2,1,4,3,5] => 35
[6,2,1,4,5,3] => 26
[6,2,1,5,3,4] => 35
[6,2,1,5,4,3] => 19
[6,2,3,1,4,5] => 35
[6,2,3,1,5,4] => 61
[6,2,3,4,1,5] => 40
[6,2,3,4,5,1] => 19
[6,2,3,5,1,4] => 40
[6,2,3,5,4,1] => 26
[6,2,4,1,3,5] => 35
[6,2,4,1,5,3] => 61
[6,2,4,3,1,5] => 40
[6,2,4,3,5,1] => 61
[6,2,4,5,1,3] => 40
[6,2,4,5,3,1] => 26
[6,2,5,1,3,4] => 35
[6,2,5,1,4,3] => 61
[6,2,5,3,1,4] => 40
[6,2,5,3,4,1] => 61
[6,2,5,4,1,3] => 40
[6,2,5,4,3,1] => 14
[6,3,1,2,4,5] => 10
[6,3,1,2,5,4] => 26
[6,3,1,4,2,5] => 35
[6,3,1,4,5,2] => 26
[6,3,1,5,2,4] => 35
[6,3,1,5,4,2] => 19
[6,3,2,1,4,5] => 10
[6,3,2,1,5,4] => 14
[6,3,2,4,1,5] => 35
[6,3,2,4,5,1] => 26
[6,3,2,5,1,4] => 35
[6,3,2,5,4,1] => 19
[6,3,4,1,2,5] => 35
[6,3,4,1,5,2] => 61
[6,3,4,2,1,5] => 40
[6,3,4,2,5,1] => 61
[6,3,4,5,1,2] => 40
[6,3,4,5,2,1] => 26
[6,3,5,1,2,4] => 35
[6,3,5,1,4,2] => 61
[6,3,5,2,1,4] => 40
[6,3,5,2,4,1] => 61
[6,3,5,4,1,2] => 40
[6,3,5,4,2,1] => 14
[6,4,1,2,3,5] => 10
[6,4,1,2,5,3] => 26
[6,4,1,3,2,5] => 35
[6,4,1,3,5,2] => 26
[6,4,1,5,2,3] => 35
[6,4,1,5,3,2] => 19
[6,4,2,1,3,5] => 10
[6,4,2,1,5,3] => 14
[6,4,2,3,1,5] => 35
[6,4,2,3,5,1] => 26
[6,4,2,5,1,3] => 35
[6,4,2,5,3,1] => 19
[6,4,3,1,2,5] => 10
[6,4,3,1,5,2] => 14
[6,4,3,2,1,5] => 5
[6,4,3,2,5,1] => 14
[6,4,3,5,1,2] => 35
[6,4,3,5,2,1] => 19
[6,4,5,1,2,3] => 35
[6,4,5,1,3,2] => 61
[6,4,5,2,1,3] => 40
[6,4,5,2,3,1] => 61
[6,4,5,3,1,2] => 40
[6,4,5,3,2,1] => 14
[6,5,1,2,3,4] => 10
[6,5,1,2,4,3] => 26
[6,5,1,3,2,4] => 35
[6,5,1,3,4,2] => 26
[6,5,1,4,2,3] => 35
[6,5,1,4,3,2] => 19
[6,5,2,1,3,4] => 10
[6,5,2,1,4,3] => 14
[6,5,2,3,1,4] => 35
[6,5,2,3,4,1] => 26
[6,5,2,4,1,3] => 35
[6,5,2,4,3,1] => 19
[6,5,3,1,2,4] => 10
[6,5,3,1,4,2] => 14
[6,5,3,2,1,4] => 5
[6,5,3,2,4,1] => 14
[6,5,3,4,1,2] => 35
[6,5,3,4,2,1] => 19
[6,5,4,1,2,3] => 10
[6,5,4,1,3,2] => 14
[6,5,4,2,1,3] => 5
[6,5,4,2,3,1] => 14
[6,5,4,3,1,2] => 5
[6,5,4,3,2,1] => 1
[1,2,3,4,5,6,7] => 1
[1,2,3,4,5,7,6] => 6
[1,2,3,4,6,5,7] => 20
[1,2,3,4,6,7,5] => 6
[1,2,3,4,7,5,6] => 20
[1,2,3,4,7,6,5] => 15
[1,2,3,5,4,6,7] => 34
[1,2,3,5,4,7,6] => 64
[1,2,3,5,6,4,7] => 20
[1,2,3,5,6,7,4] => 6
[1,2,3,5,7,4,6] => 20
[1,2,3,5,7,6,4] => 15
[1,2,3,6,4,5,7] => 34
[1,2,3,6,4,7,5] => 64
[1,2,3,6,5,4,7] => 50
[1,2,3,6,5,7,4] => 64
[1,2,3,6,7,4,5] => 20
[1,2,3,6,7,5,4] => 15
[1,2,3,7,4,5,6] => 34
[1,2,3,7,4,6,5] => 64
[1,2,3,7,5,4,6] => 50
[1,2,3,7,5,6,4] => 64
[1,2,3,7,6,4,5] => 50
[1,2,3,7,6,5,4] => 20
[1,2,4,3,5,6,7] => 34
[1,2,4,3,5,7,6] => 99
[1,2,4,3,6,5,7] => 155
[1,2,4,3,6,7,5] => 99
[1,2,4,3,7,5,6] => 155
[1,2,4,3,7,6,5] => 90
[1,2,4,5,3,6,7] => 34
[1,2,4,5,3,7,6] => 64
[1,2,4,5,6,3,7] => 20
[1,2,4,5,6,7,3] => 6
[1,2,4,5,7,3,6] => 20
[1,2,4,5,7,6,3] => 15
[1,2,4,6,3,5,7] => 34
[1,2,4,6,3,7,5] => 64
[1,2,4,6,5,3,7] => 50
[1,2,4,6,5,7,3] => 64
[1,2,4,6,7,3,5] => 20
[1,2,4,6,7,5,3] => 15
[1,2,4,7,3,5,6] => 34
[1,2,4,7,3,6,5] => 64
[1,2,4,7,5,3,6] => 50
[1,2,4,7,5,6,3] => 64
[1,2,4,7,6,3,5] => 50
[1,2,4,7,6,5,3] => 20
[1,2,5,3,4,6,7] => 34
[1,2,5,3,4,7,6] => 99
[1,2,5,3,6,4,7] => 155
[1,2,5,3,6,7,4] => 99
[1,2,5,3,7,4,6] => 155
[1,2,5,3,7,6,4] => 90
[1,2,5,4,3,6,7] => 71
[1,2,5,4,3,7,6] => 111
[1,2,5,4,6,3,7] => 155
[1,2,5,4,6,7,3] => 99
[1,2,5,4,7,3,6] => 155
[1,2,5,4,7,6,3] => 90
[1,2,5,6,3,4,7] => 34
[1,2,5,6,3,7,4] => 64
[1,2,5,6,4,3,7] => 50
[1,2,5,6,4,7,3] => 64
[1,2,5,6,7,3,4] => 20
[1,2,5,6,7,4,3] => 15
[1,2,5,7,3,4,6] => 34
[1,2,5,7,3,6,4] => 64
[1,2,5,7,4,3,6] => 50
[1,2,5,7,4,6,3] => 64
[1,2,5,7,6,3,4] => 50
[1,2,5,7,6,4,3] => 20
[1,2,6,3,4,5,7] => 34
[1,2,6,3,4,7,5] => 99
[1,2,6,3,5,4,7] => 155
[1,2,6,3,5,7,4] => 99
[1,2,6,3,7,4,5] => 155
[1,2,6,3,7,5,4] => 90
[1,2,6,4,3,5,7] => 71
[1,2,6,4,3,7,5] => 111
[1,2,6,4,5,3,7] => 155
[1,2,6,4,5,7,3] => 99
[1,2,6,4,7,3,5] => 155
[1,2,6,4,7,5,3] => 90
[1,2,6,5,3,4,7] => 71
[1,2,6,5,3,7,4] => 111
[1,2,6,5,4,3,7] => 55
[1,2,6,5,4,7,3] => 111
[1,2,6,5,7,3,4] => 155
[1,2,6,5,7,4,3] => 90
[1,2,6,7,3,4,5] => 34
[1,2,6,7,3,5,4] => 64
[1,2,6,7,4,3,5] => 50
[1,2,6,7,4,5,3] => 64
[1,2,6,7,5,3,4] => 50
[1,2,6,7,5,4,3] => 20
[1,2,7,3,4,5,6] => 34
[1,2,7,3,4,6,5] => 99
[1,2,7,3,5,4,6] => 155
[1,2,7,3,5,6,4] => 99
[1,2,7,3,6,4,5] => 155
[1,2,7,3,6,5,4] => 90
[1,2,7,4,3,5,6] => 71
[1,2,7,4,3,6,5] => 111
[1,2,7,4,5,3,6] => 155
[1,2,7,4,5,6,3] => 99
[1,2,7,4,6,3,5] => 155
[1,2,7,4,6,5,3] => 90
[1,2,7,5,3,4,6] => 71
[1,2,7,5,3,6,4] => 111
[1,2,7,5,4,3,6] => 55
[1,2,7,5,4,6,3] => 111
[1,2,7,5,6,3,4] => 155
[1,2,7,5,6,4,3] => 90
[1,2,7,6,3,4,5] => 71
[1,2,7,6,3,5,4] => 111
[1,2,7,6,4,3,5] => 55
[1,2,7,6,4,5,3] => 111
[1,2,7,6,5,3,4] => 55
[1,2,7,6,5,4,3] => 15
[1,3,2,4,5,6,7] => 20
[1,3,2,4,5,7,6] => 78
[1,3,2,4,6,5,7] => 169
[1,3,2,4,6,7,5] => 78
[1,3,2,4,7,5,6] => 169
[1,3,2,4,7,6,5] => 111
[1,3,2,5,4,6,7] => 155
[1,3,2,5,4,7,6] => 272
[1,3,2,5,6,4,7] => 169
[1,3,2,5,6,7,4] => 78
[1,3,2,5,7,4,6] => 169
[1,3,2,5,7,6,4] => 111
[1,3,2,6,4,5,7] => 155
[1,3,2,6,4,7,5] => 272
[1,3,2,6,5,4,7] => 181
[1,3,2,6,5,7,4] => 272
[1,3,2,6,7,4,5] => 169
[1,3,2,6,7,5,4] => 111
[1,3,2,7,4,5,6] => 155
[1,3,2,7,4,6,5] => 272
[1,3,2,7,5,4,6] => 181
[1,3,2,7,5,6,4] => 272
[1,3,2,7,6,4,5] => 181
[1,3,2,7,6,5,4] => 64
[1,3,4,2,5,6,7] => 34
[1,3,4,2,5,7,6] => 99
[1,3,4,2,6,5,7] => 155
[1,3,4,2,6,7,5] => 99
[1,3,4,2,7,5,6] => 155
[1,3,4,2,7,6,5] => 90
[1,3,4,5,2,6,7] => 34
[1,3,4,5,2,7,6] => 64
[1,3,4,5,6,2,7] => 20
[1,3,4,5,6,7,2] => 6
[1,3,4,5,7,2,6] => 20
[1,3,4,5,7,6,2] => 15
[1,3,4,6,2,5,7] => 34
[1,3,4,6,2,7,5] => 64
[1,3,4,6,5,2,7] => 50
[1,3,4,6,5,7,2] => 64
[1,3,4,6,7,2,5] => 20
[1,3,4,6,7,5,2] => 15
[1,3,4,7,2,5,6] => 34
[1,3,4,7,2,6,5] => 64
[1,3,4,7,5,2,6] => 50
[1,3,4,7,5,6,2] => 64
[1,3,4,7,6,2,5] => 50
[1,3,4,7,6,5,2] => 20
[1,3,5,2,4,6,7] => 34
[1,3,5,2,4,7,6] => 99
[1,3,5,2,6,4,7] => 155
[1,3,5,2,6,7,4] => 99
[1,3,5,2,7,4,6] => 155
[1,3,5,2,7,6,4] => 90
[1,3,5,4,2,6,7] => 71
[1,3,5,4,2,7,6] => 111
[1,3,5,4,6,2,7] => 155
[1,3,5,4,6,7,2] => 99
[1,3,5,4,7,2,6] => 155
[1,3,5,4,7,6,2] => 90
[1,3,5,6,2,4,7] => 34
[1,3,5,6,2,7,4] => 64
[1,3,5,6,4,2,7] => 50
[1,3,5,6,4,7,2] => 64
[1,3,5,6,7,2,4] => 20
[1,3,5,6,7,4,2] => 15
[1,3,5,7,2,4,6] => 34
[1,3,5,7,2,6,4] => 64
[1,3,5,7,4,2,6] => 50
[1,3,5,7,4,6,2] => 64
[1,3,5,7,6,2,4] => 50
[1,3,5,7,6,4,2] => 20
[1,3,6,2,4,5,7] => 34
[1,3,6,2,4,7,5] => 99
[1,3,6,2,5,4,7] => 155
[1,3,6,2,5,7,4] => 99
[1,3,6,2,7,4,5] => 155
[1,3,6,2,7,5,4] => 90
[1,3,6,4,2,5,7] => 71
[1,3,6,4,2,7,5] => 111
[1,3,6,4,5,2,7] => 155
[1,3,6,4,5,7,2] => 99
[1,3,6,4,7,2,5] => 155
[1,3,6,4,7,5,2] => 90
[1,3,6,5,2,4,7] => 71
[1,3,6,5,2,7,4] => 111
[1,3,6,5,4,2,7] => 55
[1,3,6,5,4,7,2] => 111
[1,3,6,5,7,2,4] => 155
[1,3,6,5,7,4,2] => 90
[1,3,6,7,2,4,5] => 34
[1,3,6,7,2,5,4] => 64
[1,3,6,7,4,2,5] => 50
[1,3,6,7,4,5,2] => 64
[1,3,6,7,5,2,4] => 50
[1,3,6,7,5,4,2] => 20
[1,3,7,2,4,5,6] => 34
[1,3,7,2,4,6,5] => 99
[1,3,7,2,5,4,6] => 155
[1,3,7,2,5,6,4] => 99
[1,3,7,2,6,4,5] => 155
[1,3,7,2,6,5,4] => 90
[1,3,7,4,2,5,6] => 71
[1,3,7,4,2,6,5] => 111
[1,3,7,4,5,2,6] => 155
[1,3,7,4,5,6,2] => 99
[1,3,7,4,6,2,5] => 155
[1,3,7,4,6,5,2] => 90
[1,3,7,5,2,4,6] => 71
[1,3,7,5,2,6,4] => 111
[1,3,7,5,4,2,6] => 55
[1,3,7,5,4,6,2] => 111
[1,3,7,5,6,2,4] => 155
[1,3,7,5,6,4,2] => 90
[1,3,7,6,2,4,5] => 71
[1,3,7,6,2,5,4] => 111
[1,3,7,6,4,2,5] => 55
[1,3,7,6,4,5,2] => 111
[1,3,7,6,5,2,4] => 55
[1,3,7,6,5,4,2] => 15
[1,4,2,3,5,6,7] => 20
[1,4,2,3,5,7,6] => 78
[1,4,2,3,6,5,7] => 169
[1,4,2,3,6,7,5] => 78
[1,4,2,3,7,5,6] => 169
[1,4,2,3,7,6,5] => 111
[1,4,2,5,3,6,7] => 155
[1,4,2,5,3,7,6] => 272
[1,4,2,5,6,3,7] => 169
[1,4,2,5,6,7,3] => 78
[1,4,2,5,7,3,6] => 169
[1,4,2,5,7,6,3] => 111
[1,4,2,6,3,5,7] => 155
[1,4,2,6,3,7,5] => 272
[1,4,2,6,5,3,7] => 181
[1,4,2,6,5,7,3] => 272
[1,4,2,6,7,3,5] => 169
[1,4,2,6,7,5,3] => 111
[1,4,2,7,3,5,6] => 155
[1,4,2,7,3,6,5] => 272
[1,4,2,7,5,3,6] => 181
[1,4,2,7,5,6,3] => 272
[1,4,2,7,6,3,5] => 181
[1,4,2,7,6,5,3] => 64
[1,4,3,2,5,6,7] => 50
[1,4,3,2,5,7,6] => 132
[1,4,3,2,6,5,7] => 181
[1,4,3,2,6,7,5] => 132
[1,4,3,2,7,5,6] => 181
[1,4,3,2,7,6,5] => 99
[1,4,3,5,2,6,7] => 155
[1,4,3,5,2,7,6] => 272
[1,4,3,5,6,2,7] => 169
[1,4,3,5,6,7,2] => 78
[1,4,3,5,7,2,6] => 169
[1,4,3,5,7,6,2] => 111
[1,4,3,6,2,5,7] => 155
[1,4,3,6,2,7,5] => 272
[1,4,3,6,5,2,7] => 181
[1,4,3,6,5,7,2] => 272
[1,4,3,6,7,2,5] => 169
[1,4,3,6,7,5,2] => 111
[1,4,3,7,2,5,6] => 155
[1,4,3,7,2,6,5] => 272
[1,4,3,7,5,2,6] => 181
[1,4,3,7,5,6,2] => 272
[1,4,3,7,6,2,5] => 181
[1,4,3,7,6,5,2] => 64
[1,4,5,2,3,6,7] => 34
[1,4,5,2,3,7,6] => 99
[1,4,5,2,6,3,7] => 155
[1,4,5,2,6,7,3] => 99
[1,4,5,2,7,3,6] => 155
[1,4,5,2,7,6,3] => 90
[1,4,5,3,2,6,7] => 71
[1,4,5,3,2,7,6] => 111
[1,4,5,3,6,2,7] => 155
[1,4,5,3,6,7,2] => 99
[1,4,5,3,7,2,6] => 155
[1,4,5,3,7,6,2] => 90
[1,4,5,6,2,3,7] => 34
[1,4,5,6,2,7,3] => 64
[1,4,5,6,3,2,7] => 50
[1,4,5,6,3,7,2] => 64
[1,4,5,6,7,2,3] => 20
[1,4,5,6,7,3,2] => 15
[1,4,5,7,2,3,6] => 34
[1,4,5,7,2,6,3] => 64
[1,4,5,7,3,2,6] => 50
[1,4,5,7,3,6,2] => 64
[1,4,5,7,6,2,3] => 50
[1,4,5,7,6,3,2] => 20
[1,4,6,2,3,5,7] => 34
[1,4,6,2,3,7,5] => 99
[1,4,6,2,5,3,7] => 155
[1,4,6,2,5,7,3] => 99
[1,4,6,2,7,3,5] => 155
[1,4,6,2,7,5,3] => 90
[1,4,6,3,2,5,7] => 71
[1,4,6,3,2,7,5] => 111
[1,4,6,3,5,2,7] => 155
[1,4,6,3,5,7,2] => 99
[1,4,6,3,7,2,5] => 155
[1,4,6,3,7,5,2] => 90
[1,4,6,5,2,3,7] => 71
[1,4,6,5,2,7,3] => 111
[1,4,6,5,3,2,7] => 55
[1,4,6,5,3,7,2] => 111
click to show generating function       
Description
The number of permutations with the same descent word as the given permutation.
The descent word of a permutation is the binary word given by Mp00109descent word. For a given permutation, this statistic is the number of permutations with the same descent word, so the number of elements in the fiber of the map Mp00109descent word containing a given permutation.
This statistic appears as up-down analysis in statistical applications in genetics, see [1] and the references therein.
References
[1] Morton, J., Pachter, L., Shiu, A., Sturmfels, B., Wienand, O. Convex rank tests and semigraphoids MathSciNet:2538642
Code
from collections import defaultdict

def word(pi):
    w = [0]*(len(pi)-1)
    for i in pi.descents(from_zero=True):
        w[i] = 1
    return Words([0,1])(w)

@cached_function
def preimages(n):
    D = defaultdict(int)
    for pi in Permutations(n):
        D[word(pi)] += 1
    return D


def statistic(pi):
    return preimages(len(pi))[word(pi)]

Created
Jun 10, 2016 at 08:54 by Christian Stump
Updated
Jan 15, 2018 at 08:00 by Martin Rubey