Identifier
Identifier
Values
[1,2] => 3
[2,1] => 3
[1,2,3] => 4
[1,3,2] => 5
[2,1,3] => 5
[2,3,1] => 5
[3,1,2] => 5
[3,2,1] => 4
[1,2,3,4] => 5
[1,2,4,3] => 7
[1,3,2,4] => 8
[1,3,4,2] => 8
[1,4,2,3] => 8
[1,4,3,2] => 7
[2,1,3,4] => 7
[2,1,4,3] => 7
[2,3,1,4] => 8
[2,3,4,1] => 7
[2,4,1,3] => 9
[2,4,3,1] => 8
[3,1,2,4] => 8
[3,1,4,2] => 9
[3,2,1,4] => 7
[3,2,4,1] => 8
[3,4,1,2] => 7
[3,4,2,1] => 7
[4,1,2,3] => 7
[4,1,3,2] => 8
[4,2,1,3] => 8
[4,2,3,1] => 8
[4,3,1,2] => 7
[4,3,2,1] => 5
[1,2,3,4,5] => 6
[1,2,3,5,4] => 9
[1,2,4,3,5] => 11
[1,2,4,5,3] => 11
[1,2,5,3,4] => 11
[1,2,5,4,3] => 10
[1,3,2,4,5] => 11
[1,3,2,5,4] => 11
[1,3,4,2,5] => 13
[1,3,4,5,2] => 11
[1,3,5,2,4] => 15
[1,3,5,4,2] => 13
[1,4,2,3,5] => 13
[1,4,2,5,3] => 15
[1,4,3,2,5] => 12
[1,4,3,5,2] => 14
[1,4,5,2,3] => 12
[1,4,5,3,2] => 12
[1,5,2,3,4] => 11
[1,5,2,4,3] => 13
[1,5,3,2,4] => 14
[1,5,3,4,2] => 14
[1,5,4,2,3] => 12
[1,5,4,3,2] => 9
[2,1,3,4,5] => 9
[2,1,3,5,4] => 11
[2,1,4,3,5] => 11
[2,1,4,5,3] => 12
[2,1,5,3,4] => 12
[2,1,5,4,3] => 10
[2,3,1,4,5] => 11
[2,3,1,5,4] => 12
[2,3,4,1,5] => 11
[2,3,4,5,1] => 9
[2,3,5,1,4] => 14
[2,3,5,4,1] => 12
[2,4,1,3,5] => 15
[2,4,1,5,3] => 15
[2,4,3,1,5] => 14
[2,4,3,5,1] => 14
[2,4,5,1,3] => 14
[2,4,5,3,1] => 13
[2,5,1,3,4] => 14
[2,5,1,4,3] => 14
[2,5,3,1,4] => 16
[2,5,3,4,1] => 14
[2,5,4,1,3] => 14
[2,5,4,3,1] => 11
[3,1,2,4,5] => 11
[3,1,2,5,4] => 12
[3,1,4,2,5] => 15
[3,1,4,5,2] => 14
[3,1,5,2,4] => 15
[3,1,5,4,2] => 14
[3,2,1,4,5] => 10
[3,2,1,5,4] => 10
[3,2,4,1,5] => 13
[3,2,4,5,1] => 12
[3,2,5,1,4] => 14
[3,2,5,4,1] => 12
[3,4,1,2,5] => 12
[3,4,1,5,2] => 14
[3,4,2,1,5] => 12
[3,4,2,5,1] => 13
[3,4,5,1,2] => 10
[3,4,5,2,1] => 10
[3,5,1,2,4] => 14
[3,5,1,4,2] => 15
[3,5,2,1,4] => 14
[3,5,2,4,1] => 15
[3,5,4,1,2] => 12
[3,5,4,2,1] => 11
[4,1,2,3,5] => 11
[4,1,2,5,3] => 14
[4,1,3,2,5] => 14
[4,1,3,5,2] => 16
[4,1,5,2,3] => 14
[4,1,5,3,2] => 14
[4,2,1,3,5] => 13
[4,2,1,5,3] => 14
[4,2,3,1,5] => 14
[4,2,3,5,1] => 14
[4,2,5,1,3] => 15
[4,2,5,3,1] => 15
[4,3,1,2,5] => 12
[4,3,1,5,2] => 14
[4,3,2,1,5] => 9
[4,3,2,5,1] => 11
[4,3,5,1,2] => 12
[4,3,5,2,1] => 11
[4,5,1,2,3] => 10
[4,5,1,3,2] => 12
[4,5,2,1,3] => 12
[4,5,2,3,1] => 11
[4,5,3,1,2] => 11
[4,5,3,2,1] => 9
[5,1,2,3,4] => 9
[5,1,2,4,3] => 12
[5,1,3,2,4] => 14
[5,1,3,4,2] => 14
[5,1,4,2,3] => 13
[5,1,4,3,2] => 11
[5,2,1,3,4] => 12
[5,2,1,4,3] => 12
[5,2,3,1,4] => 14
[5,2,3,4,1] => 12
[5,2,4,1,3] => 15
[5,2,4,3,1] => 13
[5,3,1,2,4] => 13
[5,3,1,4,2] => 15
[5,3,2,1,4] => 11
[5,3,2,4,1] => 13
[5,3,4,1,2] => 11
[5,3,4,2,1] => 11
[5,4,1,2,3] => 10
[5,4,1,3,2] => 11
[5,4,2,1,3] => 11
[5,4,2,3,1] => 11
[5,4,3,1,2] => 9
[5,4,3,2,1] => 6
[1,2,3,4,5,6] => 7
[1,2,3,4,6,5] => 11
[1,2,3,5,4,6] => 14
[1,2,3,5,6,4] => 14
[1,2,3,6,4,5] => 14
[1,2,3,6,5,4] => 13
[1,2,4,3,5,6] => 15
[1,2,4,3,6,5] => 15
[1,2,4,5,3,6] => 18
[1,2,4,5,6,3] => 15
[1,2,4,6,3,5] => 21
[1,2,4,6,5,3] => 18
[1,2,5,3,4,6] => 18
[1,2,5,3,6,4] => 21
[1,2,5,4,3,6] => 17
[1,2,5,4,6,3] => 20
[1,2,5,6,3,4] => 17
[1,2,5,6,4,3] => 17
[1,2,6,3,4,5] => 15
[1,2,6,3,5,4] => 18
[1,2,6,4,3,5] => 20
[1,2,6,4,5,3] => 20
[1,2,6,5,3,4] => 17
[1,2,6,5,4,3] => 13
[1,3,2,4,5,6] => 14
[1,3,2,4,6,5] => 17
[1,3,2,5,4,6] => 17
[1,3,2,5,6,4] => 19
[1,3,2,6,4,5] => 19
[1,3,2,6,5,4] => 16
[1,3,4,2,5,6] => 18
[1,3,4,2,6,5] => 19
[1,3,4,5,2,6] => 18
[1,3,4,5,6,2] => 14
[1,3,4,6,2,5] => 23
[1,3,4,6,5,2] => 19
[1,3,5,2,4,6] => 25
[1,3,5,2,6,4] => 25
[1,3,5,4,2,6] => 23
[1,3,5,4,6,2] => 23
[1,3,5,6,2,4] => 23
[1,3,5,6,4,2] => 21
[1,3,6,2,4,5] => 23
[1,3,6,2,5,4] => 24
[1,3,6,4,2,5] => 27
[1,3,6,4,5,2] => 23
[1,3,6,5,2,4] => 24
[1,3,6,5,4,2] => 18
[1,4,2,3,5,6] => 18
[1,4,2,3,6,5] => 19
[1,4,2,5,3,6] => 25
[1,4,2,5,6,3] => 23
[1,4,2,6,3,5] => 25
[1,4,2,6,5,3] => 24
[1,4,3,2,5,6] => 17
[1,4,3,2,6,5] => 17
[1,4,3,5,2,6] => 23
[1,4,3,5,6,2] => 21
[1,4,3,6,2,5] => 25
[1,4,3,6,5,2] => 21
[1,4,5,2,3,6] => 21
[1,4,5,2,6,3] => 24
[1,4,5,3,2,6] => 21
[1,4,5,3,6,2] => 23
[1,4,5,6,2,3] => 17
[1,4,5,6,3,2] => 17
[1,4,6,2,3,5] => 24
[1,4,6,2,5,3] => 27
[1,4,6,3,2,5] => 25
[1,4,6,3,5,2] => 27
[1,4,6,5,2,3] => 21
[1,4,6,5,3,2] => 19
[1,5,2,3,4,6] => 18
[1,5,2,3,6,4] => 23
[1,5,2,4,3,6] => 23
[1,5,2,4,6,3] => 27
[1,5,2,6,3,4] => 23
[1,5,2,6,4,3] => 24
[1,5,3,2,4,6] => 23
[1,5,3,2,6,4] => 25
[1,5,3,4,2,6] => 25
[1,5,3,4,6,2] => 25
[1,5,3,6,2,4] => 27
[1,5,3,6,4,2] => 27
[1,5,4,2,3,6] => 21
[1,5,4,2,6,3] => 25
[1,5,4,3,2,6] => 16
[1,5,4,3,6,2] => 20
[1,5,4,6,2,3] => 22
[1,5,4,6,3,2] => 20
[1,5,6,2,3,4] => 17
[1,5,6,2,4,3] => 21
[1,5,6,3,2,4] => 22
[1,5,6,3,4,2] => 20
[1,5,6,4,2,3] => 20
[1,5,6,4,3,2] => 16
[1,6,2,3,4,5] => 14
[1,6,2,3,5,4] => 19
[1,6,2,4,3,5] => 23
[1,6,2,4,5,3] => 23
[1,6,2,5,3,4] => 21
[1,6,2,5,4,3] => 18
[1,6,3,2,4,5] => 21
[1,6,3,2,5,4] => 21
[1,6,3,4,2,5] => 25
[1,6,3,4,5,2] => 21
[1,6,3,5,2,4] => 27
[1,6,3,5,4,2] => 23
[1,6,4,2,3,5] => 23
[1,6,4,2,5,3] => 27
[1,6,4,3,2,5] => 20
[1,6,4,3,5,2] => 24
[1,6,4,5,2,3] => 20
[1,6,4,5,3,2] => 20
[1,6,5,2,3,4] => 17
[1,6,5,2,4,3] => 19
[1,6,5,3,2,4] => 20
[1,6,5,3,4,2] => 20
[1,6,5,4,2,3] => 16
[1,6,5,4,3,2] => 11
[2,1,3,4,5,6] => 11
[2,1,3,4,6,5] => 15
[2,1,3,5,4,6] => 17
[2,1,3,5,6,4] => 18
[2,1,3,6,4,5] => 18
[2,1,3,6,5,4] => 16
[2,1,4,3,5,6] => 15
[2,1,4,3,6,5] => 15
[2,1,4,5,3,6] => 19
[2,1,4,5,6,3] => 17
[2,1,4,6,3,5] => 22
[2,1,4,6,5,3] => 20
[2,1,5,3,4,6] => 19
[2,1,5,3,6,4] => 22
[2,1,5,4,3,6] => 17
[2,1,5,4,6,3] => 20
[2,1,5,6,3,4] => 18
[2,1,5,6,4,3] => 18
[2,1,6,3,4,5] => 17
[2,1,6,3,5,4] => 20
[2,1,6,4,3,5] => 20
[2,1,6,4,5,3] => 21
[2,1,6,5,3,4] => 18
[2,1,6,5,4,3] => 13
[2,3,1,4,5,6] => 14
[2,3,1,4,6,5] => 18
[2,3,1,5,4,6] => 19
[2,3,1,5,6,4] => 19
[2,3,1,6,4,5] => 20
[2,3,1,6,5,4] => 17
[2,3,4,1,5,6] => 15
[2,3,4,1,6,5] => 17
[2,3,4,5,1,6] => 14
[2,3,4,5,6,1] => 11
[2,3,4,6,1,5] => 19
[2,3,4,6,5,1] => 16
[2,3,5,1,4,6] => 23
[2,3,5,1,6,4] => 23
[2,3,5,4,1,6] => 21
[2,3,5,4,6,1] => 20
[2,3,5,6,1,4] => 21
[2,3,5,6,4,1] => 19
[2,3,6,1,4,5] => 22
[2,3,6,1,5,4] => 22
[2,3,6,4,1,5] => 24
[2,3,6,4,5,1] => 20
[2,3,6,5,1,4] => 22
[2,3,6,5,4,1] => 17
[2,4,1,3,5,6] => 21
[2,4,1,3,6,5] => 22
[2,4,1,5,3,6] => 25
[2,4,1,5,6,3] => 23
[2,4,1,6,3,5] => 26
[2,4,1,6,5,3] => 24
[2,4,3,1,5,6] => 20
[2,4,3,1,6,5] => 20
[2,4,3,5,1,6] => 23
[2,4,3,5,6,1] => 20
[2,4,3,6,1,5] => 25
[2,4,3,6,5,1] => 20
[2,4,5,1,3,6] => 24
[2,4,5,1,6,3] => 23
[2,4,5,3,1,6] => 23
[2,4,5,3,6,1] => 23
[2,4,5,6,1,3] => 19
[2,4,5,6,3,1] => 18
[2,4,6,1,3,5] => 27
[2,4,6,1,5,3] => 28
[2,4,6,3,1,5] => 28
[2,4,6,3,5,1] => 27
[2,4,6,5,1,3] => 24
[2,4,6,5,3,1] => 21
[2,5,1,3,4,6] => 23
[2,5,1,3,6,4] => 27
[2,5,1,4,3,6] => 25
[2,5,1,4,6,3] => 28
[2,5,1,6,3,4] => 24
[2,5,1,6,4,3] => 24
[2,5,3,1,4,6] => 27
[2,5,3,1,6,4] => 28
[2,5,3,4,1,6] => 25
[2,5,3,4,6,1] => 24
[2,5,3,6,1,4] => 29
[2,5,3,6,4,1] => 27
[2,5,4,1,3,6] => 25
[2,5,4,1,6,3] => 27
[2,5,4,3,1,6] => 20
[2,5,4,3,6,1] => 21
[2,5,4,6,1,3] => 25
[2,5,4,6,3,1] => 23
[2,5,6,1,3,4] => 21
[2,5,6,1,4,3] => 23
[2,5,6,3,1,4] => 25
[2,5,6,3,4,1] => 21
[2,5,6,4,1,3] => 24
[2,5,6,4,3,1] => 19
[2,6,1,3,4,5] => 19
[2,6,1,3,5,4] => 24
[2,6,1,4,3,5] => 25
[2,6,1,4,5,3] => 25
[2,6,1,5,3,4] => 24
[2,6,1,5,4,3] => 19
[2,6,3,1,4,5] => 24
[2,6,3,1,5,4] => 25
[2,6,3,4,1,5] => 25
[2,6,3,4,5,1] => 20
[2,6,3,5,1,4] => 28
[2,6,3,5,4,1] => 23
[2,6,4,1,3,5] => 28
[2,6,4,1,5,3] => 29
[2,6,4,3,1,5] => 25
[2,6,4,3,5,1] => 25
[2,6,4,5,1,3] => 25
[2,6,4,5,3,1] => 23
[2,6,5,1,3,4] => 22
[2,6,5,1,4,3] => 21
[2,6,5,3,1,4] => 24
[2,6,5,3,4,1] => 21
[2,6,5,4,1,3] => 19
[2,6,5,4,3,1] => 14
[3,1,2,4,5,6] => 14
[3,1,2,4,6,5] => 18
[3,1,2,5,4,6] => 19
[3,1,2,5,6,4] => 20
[3,1,2,6,4,5] => 19
[3,1,2,6,5,4] => 17
[3,1,4,2,5,6] => 21
[3,1,4,2,6,5] => 22
[3,1,4,5,2,6] => 23
[3,1,4,5,6,2] => 19
[3,1,4,6,2,5] => 27
[3,1,4,6,5,2] => 24
[3,1,5,2,4,6] => 25
[3,1,5,2,6,4] => 26
[3,1,5,4,2,6] => 25
[3,1,5,4,6,2] => 25
[3,1,5,6,2,4] => 24
[3,1,5,6,4,2] => 24
[3,1,6,2,4,5] => 23
[3,1,6,2,5,4] => 24
[3,1,6,4,2,5] => 28
[3,1,6,4,5,2] => 25
[3,1,6,5,2,4] => 24
[3,1,6,5,4,2] => 19
[3,2,1,4,5,6] => 13
[3,2,1,4,6,5] => 16
[3,2,1,5,4,6] => 16
[3,2,1,5,6,4] => 17
[3,2,1,6,4,5] => 17
[3,2,1,6,5,4] => 13
[3,2,4,1,5,6] => 18
[3,2,4,1,6,5] => 20
[3,2,4,5,1,6] => 19
[3,2,4,5,6,1] => 16
[3,2,4,6,1,5] => 24
[3,2,4,6,5,1] => 20
[3,2,5,1,4,6] => 24
[3,2,5,1,6,4] => 24
[3,2,5,4,1,6] => 21
[3,2,5,4,6,1] => 20
[3,2,5,6,1,4] => 23
[3,2,5,6,4,1] => 21
[3,2,6,1,4,5] => 22
[3,2,6,1,5,4] => 20
[3,2,6,4,1,5] => 25
[3,2,6,4,5,1] => 22
[3,2,6,5,1,4] => 21
[3,2,6,5,4,1] => 17
[3,4,1,2,5,6] => 17
[3,4,1,2,6,5] => 18
[3,4,1,5,2,6] => 23
[3,4,1,5,6,2] => 21
[3,4,1,6,2,5] => 24
[3,4,1,6,5,2] => 23
[3,4,2,1,5,6] => 17
[3,4,2,1,6,5] => 18
[3,4,2,5,1,6] => 21
[3,4,2,5,6,1] => 19
[3,4,2,6,1,5] => 24
[3,4,2,6,5,1] => 21
[3,4,5,1,2,6] => 17
[3,4,5,1,6,2] => 19
[3,4,5,2,1,6] => 17
[3,4,5,2,6,1] => 18
[3,4,5,6,1,2] => 13
[3,4,5,6,2,1] => 13
[3,4,6,1,2,5] => 21
[3,4,6,1,5,2] => 24
[3,4,6,2,1,5] => 22
[3,4,6,2,5,1] => 24
[3,4,6,5,1,2] => 18
[3,4,6,5,2,1] => 17
[3,5,1,2,4,6] => 23
[3,5,1,2,6,4] => 24
[3,5,1,4,2,6] => 27
[3,5,1,4,6,2] => 29
[3,5,1,6,2,4] => 26
[3,5,1,6,4,2] => 28
[3,5,2,1,4,6] => 24
[3,5,2,1,6,4] => 24
[3,5,2,4,1,6] => 27
[3,5,2,4,6,1] => 27
[3,5,2,6,1,4] => 28
[3,5,2,6,4,1] => 27
[3,5,4,1,2,6] => 22
[3,5,4,1,6,2] => 25
[3,5,4,2,1,6] => 20
[3,5,4,2,6,1] => 23
[3,5,4,6,1,2] => 21
[3,5,4,6,2,1] => 20
[3,5,6,1,2,4] => 20
[3,5,6,1,4,2] => 24
[3,5,6,2,1,4] => 22
[3,5,6,2,4,1] => 24
[3,5,6,4,1,2] => 20
[3,5,6,4,2,1] => 18
[3,6,1,2,4,5] => 21
[3,6,1,2,5,4] => 23
[3,6,1,4,2,5] => 29
[3,6,1,4,5,2] => 27
[3,6,1,5,2,4] => 28
[3,6,1,5,4,2] => 23
[3,6,2,1,4,5] => 22
[3,6,2,1,5,4] => 21
[3,6,2,4,1,5] => 28
[3,6,2,4,5,1] => 25
[3,6,2,5,1,4] => 27
[3,6,2,5,4,1] => 24
[3,6,4,1,2,5] => 25
[3,6,4,1,5,2] => 28
[3,6,4,2,1,5] => 24
[3,6,4,2,5,1] => 27
[3,6,4,5,1,2] => 20
[3,6,4,5,2,1] => 20
[3,6,5,1,2,4] => 22
[3,6,5,1,4,2] => 23
[3,6,5,2,1,4] => 22
[3,6,5,2,4,1] => 23
[3,6,5,4,1,2] => 17
[3,6,5,4,2,1] => 15
[4,1,2,3,5,6] => 15
[4,1,2,3,6,5] => 17
[4,1,2,5,3,6] => 23
[4,1,2,5,6,3] => 22
[4,1,2,6,3,5] => 23
[4,1,2,6,5,3] => 22
[4,1,3,2,5,6] => 20
[4,1,3,2,6,5] => 20
[4,1,3,5,2,6] => 27
[4,1,3,5,6,2] => 24
[4,1,3,6,2,5] => 28
[4,1,3,6,5,2] => 25
[4,1,5,2,3,6] => 24
[4,1,5,2,6,3] => 27
[4,1,5,3,2,6] => 25
[4,1,5,3,6,2] => 28
[4,1,5,6,2,3] => 21
[4,1,5,6,3,2] => 22
[4,1,6,2,3,5] => 23
[4,1,6,2,5,3] => 28
[4,1,6,3,2,5] => 27
[4,1,6,3,5,2] => 29
[4,1,6,5,2,3] => 23
[4,1,6,5,3,2] => 21
[4,2,1,3,5,6] => 18
[4,2,1,3,6,5] => 20
[4,2,1,5,3,6] => 24
[4,2,1,5,6,3] => 22
[4,2,1,6,3,5] => 24
[4,2,1,6,5,3] => 20
[4,2,3,1,5,6] => 20
[4,2,3,1,6,5] => 21
[4,2,3,5,1,6] => 23
[4,2,3,5,6,1] => 20
[4,2,3,6,1,5] => 25
[4,2,3,6,5,1] => 22
[4,2,5,1,3,6] => 27
[4,2,5,1,6,3] => 28
[4,2,5,3,1,6] => 27
[4,2,5,3,6,1] => 27
[4,2,5,6,1,3] => 24
[4,2,5,6,3,1] => 24
[4,2,6,1,3,5] => 28
[4,2,6,1,5,3] => 26
[4,2,6,3,1,5] => 29
[4,2,6,3,5,1] => 27
[4,2,6,5,1,3] => 24
[4,2,6,5,3,1] => 23
[4,3,1,2,5,6] => 17
[4,3,1,2,6,5] => 18
[4,3,1,5,2,6] => 24
[4,3,1,5,6,2] => 22
[4,3,1,6,2,5] => 24
[4,3,1,6,5,2] => 21
[4,3,2,1,5,6] => 13
[4,3,2,1,6,5] => 13
[4,3,2,5,1,6] => 18
[4,3,2,5,6,1] => 17
[4,3,2,6,1,5] => 19
[4,3,2,6,5,1] => 17
[4,3,5,1,2,6] => 21
[4,3,5,1,6,2] => 24
[4,3,5,2,1,6] => 19
[4,3,5,2,6,1] => 21
[4,3,5,6,1,2] => 18
[4,3,5,6,2,1] => 17
[4,3,6,1,2,5] => 23
[4,3,6,1,5,2] => 24
[4,3,6,2,1,5] => 21
[4,3,6,2,5,1] => 23
[4,3,6,5,1,2] => 18
[4,3,6,5,2,1] => 17
[4,5,1,2,3,6] => 17
[4,5,1,2,6,3] => 21
[4,5,1,3,2,6] => 22
[4,5,1,3,6,2] => 25
[4,5,1,6,2,3] => 20
[4,5,1,6,3,2] => 22
[4,5,2,1,3,6] => 21
[4,5,2,1,6,3] => 23
[4,5,2,3,1,6] => 20
[4,5,2,3,6,1] => 21
[4,5,2,6,1,3] => 24
[4,5,2,6,3,1] => 24
[4,5,3,1,2,6] => 20
[4,5,3,1,6,2] => 24
[4,5,3,2,1,6] => 16
[4,5,3,2,6,1] => 19
[4,5,3,6,1,2] => 20
[4,5,3,6,2,1] => 18
[4,5,6,1,2,3] => 13
[4,5,6,1,3,2] => 17
[4,5,6,2,1,3] => 17
[4,5,6,2,3,1] => 16
[4,5,6,3,1,2] => 16
[4,5,6,3,2,1] => 13
[4,6,1,2,3,5] => 19
[4,6,1,2,5,3] => 24
[4,6,1,3,2,5] => 25
[4,6,1,3,5,2] => 28
[4,6,1,5,2,3] => 24
[4,6,1,5,3,2] => 23
[4,6,2,1,3,5] => 24
[4,6,2,1,5,3] => 24
[4,6,2,3,1,5] => 25
[4,6,2,3,5,1] => 25
[4,6,2,5,1,3] => 26
[4,6,2,5,3,1] => 25
[4,6,3,1,2,5] => 24
[4,6,3,1,5,2] => 27
[4,6,3,2,1,5] => 19
[4,6,3,2,5,1] => 23
[4,6,3,5,1,2] => 22
[4,6,3,5,2,1] => 21
[4,6,5,1,2,3] => 17
[4,6,5,1,3,2] => 19
[4,6,5,2,1,3] => 20
[4,6,5,2,3,1] => 19
[4,6,5,3,1,2] => 18
[4,6,5,3,2,1] => 14
[5,1,2,3,4,6] => 14
[5,1,2,3,6,4] => 19
[5,1,2,4,3,6] => 21
[5,1,2,4,6,3] => 24
[5,1,2,6,3,4] => 21
[5,1,2,6,4,3] => 22
[5,1,3,2,4,6] => 23
[5,1,3,2,6,4] => 25
[5,1,3,4,2,6] => 25
[5,1,3,4,6,2] => 25
[5,1,3,6,2,4] => 29
[5,1,3,6,4,2] => 28
[5,1,4,2,3,6] => 23
[5,1,4,2,6,3] => 28
[5,1,4,3,2,6] => 20
[5,1,4,3,6,2] => 25
[5,1,4,6,2,3] => 25
[5,1,4,6,3,2] => 24
[5,1,6,2,3,4] => 19
[5,1,6,2,4,3] => 24
[5,1,6,3,2,4] => 25
[5,1,6,3,4,2] => 25
[5,1,6,4,2,3] => 24
[5,1,6,4,3,2] => 19
[5,2,1,3,4,6] => 19
[5,2,1,3,6,4] => 24
[5,2,1,4,3,6] => 21
[5,2,1,4,6,3] => 25
[5,2,1,6,3,4] => 23
[5,2,1,6,4,3] => 21
[5,2,3,1,4,6] => 23
[5,2,3,1,6,4] => 25
[5,2,3,4,1,6] => 21
[5,2,3,4,6,1] => 20
[5,2,3,6,1,4] => 27
[5,2,3,6,4,1] => 25
[5,2,4,1,3,6] => 27
[5,2,4,1,6,3] => 29
[5,2,4,3,1,6] => 24
[5,2,4,3,6,1] => 25
[5,2,4,6,1,3] => 28
[5,2,4,6,3,1] => 27
[5,2,6,1,3,4] => 24
[5,2,6,1,4,3] => 24
[5,2,6,3,1,4] => 28
[5,2,6,3,4,1] => 25
[5,2,6,4,1,3] => 27
[5,2,6,4,3,1] => 23
[5,3,1,2,4,6] => 21
[5,3,1,2,6,4] => 24
[5,3,1,4,2,6] => 27
[5,3,1,4,6,2] => 28
[5,3,1,6,2,4] => 28
[5,3,1,6,4,2] => 27
[5,3,2,1,4,6] => 18
[5,3,2,1,6,4] => 19
[5,3,2,4,1,6] => 23
[5,3,2,4,6,1] => 23
[5,3,2,6,1,4] => 23
[5,3,2,6,4,1] => 24
[5,3,4,1,2,6] => 20
[5,3,4,1,6,2] => 25
[5,3,4,2,1,6] => 20
[5,3,4,2,6,1] => 23
[5,3,4,6,1,2] => 20
[5,3,4,6,2,1] => 20
[5,3,6,1,2,4] => 24
[5,3,6,1,4,2] => 26
[5,3,6,2,1,4] => 23
[5,3,6,2,4,1] => 25
[5,3,6,4,1,2] => 22
[5,3,6,4,2,1] => 21
[5,4,1,2,3,6] => 17
[5,4,1,2,6,3] => 22
[5,4,1,3,2,6] => 20
[5,4,1,3,6,2] => 24
[5,4,1,6,2,3] => 22
[5,4,1,6,3,2] => 22
[5,4,2,1,3,6] => 19
[5,4,2,1,6,3] => 21
[5,4,2,3,1,6] => 20
[5,4,2,3,6,1] => 21
[5,4,2,6,1,3] => 23
[5,4,2,6,3,1] => 23
[5,4,3,1,2,6] => 16
[5,4,3,1,6,2] => 19
[5,4,3,2,1,6] => 11
[5,4,3,2,6,1] => 14
[5,4,3,6,1,2] => 17
[5,4,3,6,2,1] => 15
[5,4,6,1,2,3] => 17
[5,4,6,1,3,2] => 20
[5,4,6,2,1,3] => 19
[5,4,6,2,3,1] => 19
[5,4,6,3,1,2] => 18
[5,4,6,3,2,1] => 14
[5,6,1,2,3,4] => 13
[5,6,1,2,4,3] => 18
[5,6,1,3,2,4] => 21
[5,6,1,3,4,2] => 20
[5,6,1,4,2,3] => 20
[5,6,1,4,3,2] => 17
[5,6,2,1,3,4] => 18
[5,6,2,1,4,3] => 18
[5,6,2,3,1,4] => 20
[5,6,2,3,4,1] => 17
[5,6,2,4,1,3] => 22
[5,6,2,4,3,1] => 19
[5,6,3,1,2,4] => 20
[5,6,3,1,4,2] => 22
[5,6,3,2,1,4] => 17
[5,6,3,2,4,1] => 19
[5,6,3,4,1,2] => 15
[5,6,3,4,2,1] => 15
[5,6,4,1,2,3] => 16
[5,6,4,1,3,2] => 18
[5,6,4,2,1,3] => 18
[5,6,4,2,3,1] => 17
[5,6,4,3,1,2] => 15
[5,6,4,3,2,1] => 11
[6,1,2,3,4,5] => 11
[6,1,2,3,5,4] => 16
[6,1,2,4,3,5] => 20
[6,1,2,4,5,3] => 20
[6,1,2,5,3,4] => 19
[6,1,2,5,4,3] => 17
[6,1,3,2,4,5] => 20
[6,1,3,2,5,4] => 20
[6,1,3,4,2,5] => 24
[6,1,3,4,5,2] => 20
[6,1,3,5,2,4] => 27
[6,1,3,5,4,2] => 23
[6,1,4,2,3,5] => 23
[6,1,4,2,5,3] => 27
[6,1,4,3,2,5] => 21
[6,1,4,3,5,2] => 25
[6,1,4,5,2,3] => 21
[6,1,4,5,3,2] => 21
[6,1,5,2,3,4] => 18
[6,1,5,2,4,3] => 21
[6,1,5,3,2,4] => 23
[6,1,5,3,4,2] => 23
[6,1,5,4,2,3] => 19
[6,1,5,4,3,2] => 14
[6,2,1,3,4,5] => 16
[6,2,1,3,5,4] => 20
[6,2,1,4,3,5] => 20
[6,2,1,4,5,3] => 22
[6,2,1,5,3,4] => 21
[6,2,1,5,4,3] => 17
[6,2,3,1,4,5] => 20
[6,2,3,1,5,4] => 22
[6,2,3,4,1,5] => 20
[6,2,3,4,5,1] => 16
[6,2,3,5,1,4] => 25
[6,2,3,5,4,1] => 21
[6,2,4,1,3,5] => 27
[6,2,4,1,5,3] => 27
[6,2,4,3,1,5] => 25
[6,2,4,3,5,1] => 25
[6,2,4,5,1,3] => 25
[6,2,4,5,3,1] => 23
[6,2,5,1,3,4] => 24
[6,2,5,1,4,3] => 23
[6,2,5,3,1,4] => 27
[6,2,5,3,4,1] => 23
[6,2,5,4,1,3] => 23
[6,2,5,4,3,1] => 18
[6,3,1,2,4,5] => 19
[6,3,1,2,5,4] => 21
[6,3,1,4,2,5] => 27
[6,3,1,4,5,2] => 25
[6,3,1,5,2,4] => 27
[6,3,1,5,4,2] => 24
[6,3,2,1,4,5] => 17
[6,3,2,1,5,4] => 17
[6,3,2,4,1,5] => 23
[6,3,2,4,5,1] => 21
[6,3,2,5,1,4] => 24
[6,3,2,5,4,1] => 21
[6,3,4,1,2,5] => 21
[6,3,4,1,5,2] => 25
[6,3,4,2,1,5] => 21
[6,3,4,2,5,1] => 23
[6,3,4,5,1,2] => 17
[6,3,4,5,2,1] => 17
[6,3,5,1,2,4] => 24
[6,3,5,1,4,2] => 25
[6,3,5,2,1,4] => 23
[6,3,5,2,4,1] => 25
[6,3,5,4,1,2] => 19
[6,3,5,4,2,1] => 18
[6,4,1,2,3,5] => 18
[6,4,1,2,5,3] => 24
[6,4,1,3,2,5] => 23
[6,4,1,3,5,2] => 27
[6,4,1,5,2,3] => 24
[6,4,1,5,3,2] => 23
[6,4,2,1,3,5] => 21
[6,4,2,1,5,3] => 23
[6,4,2,3,1,5] => 23
[6,4,2,3,5,1] => 23
[6,4,2,5,1,3] => 25
[6,4,2,5,3,1] => 25
[6,4,3,1,2,5] => 19
[6,4,3,1,5,2] => 23
[6,4,3,2,1,5] => 14
[6,4,3,2,5,1] => 18
[6,4,3,5,1,2] => 19
[6,4,3,5,2,1] => 18
[6,4,5,1,2,3] => 16
[6,4,5,1,3,2] => 19
[6,4,5,2,1,3] => 19
[6,4,5,2,3,1] => 17
[6,4,5,3,1,2] => 17
[6,4,5,3,2,1] => 14
[6,5,1,2,3,4] => 13
[6,5,1,2,4,3] => 17
[6,5,1,3,2,4] => 20
[6,5,1,3,4,2] => 20
[6,5,1,4,2,3] => 18
[6,5,1,4,3,2] => 15
[6,5,2,1,3,4] => 17
[6,5,2,1,4,3] => 17
[6,5,2,3,1,4] => 20
[6,5,2,3,4,1] => 17
[6,5,2,4,1,3] => 21
[6,5,2,4,3,1] => 18
[6,5,3,1,2,4] => 18
[6,5,3,1,4,2] => 21
[6,5,3,2,1,4] => 15
[6,5,3,2,4,1] => 18
[6,5,3,4,1,2] => 15
[6,5,3,4,2,1] => 15
[6,5,4,1,2,3] => 13
[6,5,4,1,3,2] => 14
[6,5,4,2,1,3] => 14
[6,5,4,2,3,1] => 14
[6,5,4,3,1,2] => 11
[6,5,4,3,2,1] => 7
[1,2,3,4,5,6,7] => 8
[1,2,3,4,5,7,6] => 13
[1,2,3,4,6,5,7] => 17
[1,2,3,4,6,7,5] => 17
[1,2,3,4,7,5,6] => 17
[1,2,3,4,7,6,5] => 16
[1,2,3,5,4,6,7] => 19
[1,2,3,5,4,7,6] => 19
[1,2,3,5,6,4,7] => 23
[1,2,3,5,6,7,4] => 19
[1,2,3,5,7,4,6] => 27
[1,2,3,5,7,6,4] => 23
[1,2,3,6,4,5,7] => 23
[1,2,3,6,4,7,5] => 27
[1,2,3,6,5,4,7] => 22
[1,2,3,6,5,7,4] => 26
[1,2,3,6,7,4,5] => 22
[1,2,3,6,7,5,4] => 22
[1,2,3,7,4,5,6] => 19
[1,2,3,7,4,6,5] => 23
[1,2,3,7,5,4,6] => 26
[1,2,3,7,5,6,4] => 26
[1,2,3,7,6,4,5] => 22
[1,2,3,7,6,5,4] => 17
[1,2,4,3,5,6,7] => 19
[1,2,4,3,5,7,6] => 23
[1,2,4,3,6,5,7] => 23
[1,2,4,3,6,7,5] => 26
[1,2,4,3,7,5,6] => 26
[1,2,4,3,7,6,5] => 22
[1,2,4,5,3,6,7] => 25
[1,2,4,5,3,7,6] => 26
[1,2,4,5,6,3,7] => 25
[1,2,4,5,6,7,3] => 19
[1,2,4,5,7,3,6] => 32
[1,2,4,5,7,6,3] => 26
[1,2,4,6,3,5,7] => 35
[1,2,4,6,3,7,5] => 35
[1,2,4,6,5,3,7] => 32
[1,2,4,6,5,7,3] => 32
[1,2,4,6,7,3,5] => 32
[1,2,4,6,7,5,3] => 29
[1,2,4,7,3,5,6] => 32
[1,2,4,7,3,6,5] => 34
[1,2,4,7,5,3,6] => 38
[1,2,4,7,5,6,3] => 32
[1,2,4,7,6,3,5] => 34
[1,2,4,7,6,5,3] => 25
[1,2,5,3,4,6,7] => 25
[1,2,5,3,4,7,6] => 26
[1,2,5,3,6,4,7] => 35
[1,2,5,3,6,7,4] => 32
[1,2,5,3,7,4,6] => 35
[1,2,5,3,7,6,4] => 34
[1,2,5,4,3,6,7] => 24
[1,2,5,4,3,7,6] => 24
[1,2,5,4,6,3,7] => 33
[1,2,5,4,6,7,3] => 30
[1,2,5,4,7,3,6] => 36
[1,2,5,4,7,6,3] => 30
[1,2,5,6,3,4,7] => 30
[1,2,5,6,3,7,4] => 34
[1,2,5,6,4,3,7] => 30
[1,2,5,6,4,7,3] => 33
[1,2,5,6,7,3,4] => 24
[1,2,5,6,7,4,3] => 24
[1,2,5,7,3,4,6] => 34
[1,2,5,7,3,6,4] => 39
[1,2,5,7,4,3,6] => 36
[1,2,5,7,4,6,3] => 39
[1,2,5,7,6,3,4] => 30
[1,2,5,7,6,4,3] => 27
[1,2,6,3,4,5,7] => 25
[1,2,6,3,4,7,5] => 32
[1,2,6,3,5,4,7] => 32
[1,2,6,3,5,7,4] => 38
[1,2,6,3,7,4,5] => 32
[1,2,6,3,7,5,4] => 34
[1,2,6,4,3,5,7] => 33
[1,2,6,4,3,7,5] => 36
[1,2,6,4,5,3,7] => 36
[1,2,6,4,5,7,3] => 36
[1,2,6,4,7,3,5] => 39
[1,2,6,4,7,5,3] => 39
[1,2,6,5,3,4,7] => 30
[1,2,6,5,3,7,4] => 36
[1,2,6,5,4,3,7] => 23
[1,2,6,5,4,7,3] => 29
[1,2,6,5,7,3,4] => 32
[1,2,6,5,7,4,3] => 29
[1,2,6,7,3,4,5] => 24
[1,2,6,7,3,5,4] => 30
[1,2,6,7,4,3,5] => 32
[1,2,6,7,4,5,3] => 29
[1,2,6,7,5,3,4] => 29
[1,2,6,7,5,4,3] => 23
[1,2,7,3,4,5,6] => 19
[1,2,7,3,4,6,5] => 26
[1,2,7,3,5,4,6] => 32
[1,2,7,3,5,6,4] => 32
[1,2,7,3,6,4,5] => 29
[1,2,7,3,6,5,4] => 25
[1,2,7,4,3,5,6] => 30
[1,2,7,4,3,6,5] => 30
[1,2,7,4,5,3,6] => 36
[1,2,7,4,5,6,3] => 30
[1,2,7,4,6,3,5] => 39
[1,2,7,4,6,5,3] => 33
[1,2,7,5,3,4,6] => 33
[1,2,7,5,3,6,4] => 39
[1,2,7,5,4,3,6] => 29
[1,2,7,5,4,6,3] => 35
[1,2,7,5,6,3,4] => 29
[1,2,7,5,6,4,3] => 29
[1,2,7,6,3,4,5] => 24
[1,2,7,6,3,5,4] => 27
[1,2,7,6,4,3,5] => 29
[1,2,7,6,4,5,3] => 29
[1,2,7,6,5,3,4] => 23
[1,2,7,6,5,4,3] => 16
[1,3,2,4,5,6,7] => 17
[1,3,2,4,5,7,6] => 23
[1,3,2,4,6,5,7] => 26
[1,3,2,4,6,7,5] => 28
[1,3,2,4,7,5,6] => 28
[1,3,2,4,7,6,5] => 25
[1,3,2,5,4,6,7] => 23
[1,3,2,5,4,7,6] => 23
[1,3,2,5,6,4,7] => 30
[1,3,2,5,6,7,4] => 27
[1,3,2,5,7,4,6] => 35
[1,3,2,5,7,6,4] => 32
[1,3,2,6,4,5,7] => 30
[1,3,2,6,4,7,5] => 35
[1,3,2,6,5,4,7] => 27
[1,3,2,6,5,7,4] => 32
[1,3,2,6,7,4,5] => 29
[1,3,2,6,7,5,4] => 29
[1,3,2,7,4,5,6] => 27
[1,3,2,7,4,6,5] => 32
[1,3,2,7,5,4,6] => 32
[1,3,2,7,5,6,4] => 34
[1,3,2,7,6,4,5] => 29
[1,3,2,7,6,5,4] => 21
[1,3,4,2,5,6,7] => 23
[1,3,4,2,5,7,6] => 29
[1,3,4,2,6,5,7] => 30
[1,3,4,2,6,7,5] => 30
[1,3,4,2,7,5,6] => 32
[1,3,4,2,7,6,5] => 27
[1,3,4,5,2,6,7] => 25
[1,3,4,5,2,7,6] => 27
[1,3,4,5,6,2,7] => 23
[1,3,4,5,6,7,2] => 17
[1,3,4,5,7,2,6] => 31
[1,3,4,5,7,6,2] => 25
[1,3,4,6,2,5,7] => 38
[1,3,4,6,2,7,5] => 38
[1,3,4,6,5,2,7] => 34
[1,3,4,6,5,7,2] => 32
[1,3,4,6,7,2,5] => 34
[1,3,4,6,7,5,2] => 30
[1,3,4,7,2,5,6] => 36
[1,3,4,7,2,6,5] => 37
[1,3,4,7,5,2,6] => 40
[1,3,4,7,5,6,2] => 32
[1,3,4,7,6,2,5] => 37
[1,3,4,7,6,5,2] => 27
[1,3,5,2,4,6,7] => 35
[1,3,5,2,4,7,6] => 37
[1,3,5,2,6,4,7] => 42
[1,3,5,2,6,7,4] => 39
[1,3,5,2,7,4,6] => 43
[1,3,5,2,7,6,4] => 40
[1,3,5,4,2,6,7] => 33
[1,3,5,4,2,7,6] => 33
[1,3,5,4,6,2,7] => 39
[1,3,5,4,6,7,2] => 33
[1,3,5,4,7,2,6] => 43
[1,3,5,4,7,6,2] => 33
[1,3,5,6,2,4,7] => 40
[1,3,5,6,2,7,4] => 39
[1,3,5,6,4,2,7] => 38
[1,3,5,6,4,7,2] => 38
[1,3,5,6,7,2,4] => 31
[1,3,5,6,7,4,2] => 29
[1,3,5,7,2,4,6] => 45
[1,3,5,7,2,6,4] => 48
[1,3,5,7,4,2,6] => 47
[1,3,5,7,4,6,2] => 45
[1,3,5,7,6,2,4] => 40
[1,3,5,7,6,4,2] => 34
[1,3,6,2,4,5,7] => 38
[1,3,6,2,4,7,5] => 45
[1,3,6,2,5,4,7] => 43
[1,3,6,2,5,7,4] => 48
[1,3,6,2,7,4,5] => 41
[1,3,6,2,7,5,4] => 41
[1,3,6,4,2,5,7] => 46
[1,3,6,4,2,7,5] => 47
[1,3,6,4,5,2,7] => 42
[1,3,6,4,5,7,2] => 40
[1,3,6,4,7,2,5] => 49
[1,3,6,4,7,5,2] => 45
[1,3,6,5,2,4,7] => 43
[1,3,6,5,2,7,4] => 46
[1,3,6,5,4,2,7] => 33
[1,3,6,5,4,7,2] => 35
[1,3,6,5,7,2,4] => 42
[1,3,6,5,7,4,2] => 38
[1,3,6,7,2,4,5] => 35
[1,3,6,7,2,5,4] => 39
[1,3,6,7,4,2,5] => 43
[1,3,6,7,4,5,2] => 35
[1,3,6,7,5,2,4] => 41
[1,3,6,7,5,4,2] => 31
[1,3,7,2,4,5,6] => 31
[1,3,7,2,4,6,5] => 40
[1,3,7,2,5,4,6] => 42
[1,3,7,2,5,6,4] => 42
[1,3,7,2,6,4,5] => 41
[1,3,7,2,6,5,4] => 33
[1,3,7,4,2,5,6] => 41
[1,3,7,4,2,6,5] => 42
[1,3,7,4,5,2,6] => 43
[1,3,7,4,5,6,2] => 33
[1,3,7,4,6,2,5] => 48
[1,3,7,4,6,5,2] => 38
[1,3,7,5,2,4,6] => 48
[1,3,7,5,2,6,4] => 50
[1,3,7,5,4,2,6] => 42
[1,3,7,5,4,6,2] => 42
[1,3,7,5,6,2,4] => 42
[1,3,7,5,6,4,2] => 38
[1,3,7,6,2,4,5] => 37
[1,3,7,6,2,5,4] => 37
[1,3,7,6,4,2,5] => 41
[1,3,7,6,4,5,2] => 35
[1,3,7,6,5,2,4] => 33
[1,3,7,6,5,4,2] => 23
[1,4,2,3,5,6,7] => 23
[1,4,2,3,5,7,6] => 29
[1,4,2,3,6,5,7] => 30
[1,4,2,3,6,7,5] => 32
[1,4,2,3,7,5,6] => 30
[1,4,2,3,7,6,5] => 27
[1,4,2,5,3,6,7] => 35
[1,4,2,5,3,7,6] => 37
[1,4,2,5,6,3,7] => 38
[1,4,2,5,6,7,3] => 31
[1,4,2,5,7,3,6] => 45
[1,4,2,5,7,6,3] => 40
[1,4,2,6,3,5,7] => 42
[1,4,2,6,3,7,5] => 43
[1,4,2,6,5,3,7] => 43
[1,4,2,6,5,7,3] => 42
[1,4,2,6,7,3,5] => 41
[1,4,2,6,7,5,3] => 41
[1,4,2,7,3,5,6] => 39
[1,4,2,7,3,6,5] => 40
[1,4,2,7,5,3,6] => 48
[1,4,2,7,5,6,3] => 42
[1,4,2,7,6,3,5] => 41
[1,4,2,7,6,5,3] => 33
[1,4,3,2,5,6,7] => 22
[1,4,3,2,5,7,6] => 27
[1,4,3,2,6,5,7] => 27
[1,4,3,2,6,7,5] => 29
[1,4,3,2,7,5,6] => 29
[1,4,3,2,7,6,5] => 22
[1,4,3,5,2,6,7] => 32
[1,4,3,5,2,7,6] => 35
[1,4,3,5,6,2,7] => 34
[1,4,3,5,6,7,2] => 28
[1,4,3,5,7,2,6] => 43
[1,4,3,5,7,6,2] => 35
[1,4,3,6,2,5,7] => 43
[1,4,3,6,2,7,5] => 43
[1,4,3,6,5,2,7] => 37
[1,4,3,6,5,7,2] => 35
[1,4,3,6,7,2,5] => 41
[1,4,3,6,7,5,2] => 37
[1,4,3,7,2,5,6] => 39
[1,4,3,7,2,6,5] => 36
[1,4,3,7,5,2,6] => 45
[1,4,3,7,5,6,2] => 39
[1,4,3,7,6,2,5] => 38
[1,4,3,7,6,5,2] => 30
[1,4,5,2,3,6,7] => 30
[1,4,5,2,3,7,6] => 31
[1,4,5,2,6,3,7] => 40
[1,4,5,2,6,7,3] => 36
[1,4,5,2,7,3,6] => 42
[1,4,5,2,7,6,3] => 40
[1,4,5,3,2,6,7] => 30
[1,4,5,3,2,7,6] => 31
[1,4,5,3,6,2,7] => 38
[1,4,5,3,6,7,2] => 34
[1,4,5,3,7,2,6] => 43
[1,4,5,3,7,6,2] => 37
[1,4,5,6,2,3,7] => 30
[1,4,5,6,2,7,3] => 33
[1,4,5,6,3,2,7] => 30
[1,4,5,6,3,7,2] => 32
[1,4,5,6,7,2,3] => 22
[1,4,5,6,7,3,2] => 22
[1,4,5,7,2,3,6] => 37
[1,4,5,7,2,6,3] => 43
[1,4,5,7,3,2,6] => 39
[1,4,5,7,3,6,2] => 43
[1,4,5,7,6,2,3] => 31
[1,4,5,7,6,3,2] => 29
[1,4,6,2,3,5,7] => 40
[1,4,6,2,3,7,5] => 42
[1,4,6,2,5,3,7] => 49
[1,4,6,2,5,7,3] => 52
[1,4,6,2,7,3,5] => 46
[1,4,6,2,7,5,3] => 50
[1,4,6,3,2,5,7] => 43
[1,4,6,3,2,7,5] => 43
[1,4,6,3,5,2,7] => 49
[1,4,6,3,5,7,2] => 49
[1,4,6,3,7,2,5] => 51
[1,4,6,3,7,5,2] => 49
[1,4,6,5,2,3,7] => 39
[1,4,6,5,2,7,3] => 45
[1,4,6,5,3,2,7] => 35
[1,4,6,5,3,7,2] => 41
click to show generating function       
Description
The number of patterns in a permutation.
In other words, this is the number of subsequences which are not order-isomorphic.
Code
def statistic(pi):
    res = []
    for w in Subwords(pi):
        dom = sorted(w)
        res += [Permutation([dom.index(e)+1 for e in w])]
    return len(set(res))

#alternative faster code
@cached_function
def reduce_word(w):
    dom = { j:i for i,j in enumerate(sorted(w)) }
    return tuple(dom[j] for j in w)

def statistic_alternative(pi):
    res = set()
    for w in Subwords(pi):
        res.add(reduce_word(tuple(w)))
    return len(res)
Created
Jun 01, 2016 at 14:50 by Martin Rubey
Updated
Oct 17, 2017 at 11:00 by Christian Stump