Identifier
- St000520: Permutations ⟶ ℤ
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
>>> Load all 1200 entries. <<<
search for individual values
searching the database for the individual values of this statistic
/
search for generating function
searching the database for statistics with the same generating function
Description
The number of patterns in a permutation.
In other words, this is the number of subsequences which are not order-isomorphic.
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
searching the database
Sorry, this statistic was not found in the database
or
add this statistic to the database – it's very simple and we need your support!