Identifier
- St000324: Permutations ⟶ ℤ
Values
[1] => 6
[1,2] => 18
[2,1] => 12
[1,2,3] => 54
[1,3,2] => 36
[2,1,3] => 36
[2,3,1] => 36
[3,1,2] => 36
[3,2,1] => 24
[1,2,3,4] => 162
[1,2,4,3] => 108
[1,3,2,4] => 108
[1,3,4,2] => 108
[1,4,2,3] => 108
[1,4,3,2] => 72
[2,1,3,4] => 108
[2,1,4,3] => 72
[2,3,1,4] => 36
[2,3,4,1] => 108
[2,4,1,3] => 36
[2,4,3,1] => 72
[3,1,2,4] => 108
[3,1,4,2] => 72
[3,2,1,4] => 72
[3,2,4,1] => 72
[3,4,1,2] => 36
[3,4,2,1] => 72
[4,1,2,3] => 108
[4,1,3,2] => 72
[4,2,1,3] => 72
[4,2,3,1] => 72
[4,3,1,2] => 72
[4,3,2,1] => 48
[1,2,3,4,5] => 486
[1,2,3,5,4] => 324
[1,2,4,3,5] => 324
[1,2,4,5,3] => 324
[1,2,5,3,4] => 324
[1,2,5,4,3] => 216
[1,3,2,4,5] => 324
[1,3,2,5,4] => 216
[1,3,4,2,5] => 108
[1,3,4,5,2] => 324
[1,3,5,2,4] => 108
[1,3,5,4,2] => 216
[1,4,2,3,5] => 324
[1,4,2,5,3] => 216
[1,4,3,2,5] => 216
[1,4,3,5,2] => 216
[1,4,5,2,3] => 108
[1,4,5,3,2] => 216
[1,5,2,3,4] => 324
[1,5,2,4,3] => 216
[1,5,3,2,4] => 216
[1,5,3,4,2] => 216
[1,5,4,2,3] => 216
[1,5,4,3,2] => 144
[2,1,3,4,5] => 324
[2,1,3,5,4] => 216
[2,1,4,3,5] => 216
[2,1,4,5,3] => 216
[2,1,5,3,4] => 216
[2,1,5,4,3] => 144
[2,3,1,4,5] => 108
[2,3,1,5,4] => 72
[2,3,4,1,5] => 108
[2,3,4,5,1] => 324
[2,3,5,1,4] => 108
[2,3,5,4,1] => 216
[2,4,1,3,5] => 108
[2,4,1,5,3] => 72
[2,4,3,1,5] => 72
[2,4,3,5,1] => 216
[2,4,5,1,3] => 108
[2,4,5,3,1] => 216
[2,5,1,3,4] => 108
[2,5,1,4,3] => 72
[2,5,3,1,4] => 72
[2,5,3,4,1] => 216
[2,5,4,1,3] => 72
[2,5,4,3,1] => 144
[3,1,2,4,5] => 324
[3,1,2,5,4] => 216
[3,1,4,2,5] => 216
[3,1,4,5,2] => 216
[3,1,5,2,4] => 216
[3,1,5,4,2] => 144
[3,2,1,4,5] => 216
[3,2,1,5,4] => 144
[3,2,4,1,5] => 72
[3,2,4,5,1] => 216
[3,2,5,1,4] => 72
[3,2,5,4,1] => 144
[3,4,1,2,5] => 108
[3,4,1,5,2] => 72
[3,4,2,1,5] => 72
[3,4,2,5,1] => 72
[3,4,5,1,2] => 108
[3,4,5,2,1] => 216
[3,5,1,2,4] => 108
[3,5,1,4,2] => 72
>>> Load all 873 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 shape of the tree associated to a permutation.
A permutation can be mapped to a rooted tree with vertices {0,1,2,…,n} and root 0 in the following way. Entries of the permutations are inserted one after the other, each child is larger than its parent and the children are in strict order from left to right. Details of the construction are found in [1].
The statistic is given by $2^w 3^h$, where $w$ is the width St000325The width of the tree associated to a permutation. and $h$ is the height St000308The height of the tree associated to a permutation. of this tree.
A permutation can be mapped to a rooted tree with vertices {0,1,2,…,n} and root 0 in the following way. Entries of the permutations are inserted one after the other, each child is larger than its parent and the children are in strict order from left to right. Details of the construction are found in [1].
The statistic is given by $2^w 3^h$, where $w$ is the width St000325The width of the tree associated to a permutation. and $h$ is the height St000308The height of the tree associated to a permutation. of this tree.
References
Code
def statistic(pi):
if pi == []: return (0, 0)
h, w, i, branch, next = 0, 0, 0, [0], pi[0]
while true:
while next < branch[len(branch)-1]:
branch.pop()
current = 0
w += 1
while next > current:
i += 1
h = max(h, len(branch))
if i == len(pi): return 2^w*3^h
branch.append(next)
current, next = next, pi[i]
Created
Dec 11, 2015 at 11:05 by Peter Luschny
Updated
Feb 25, 2022 at 16:54 by Nadia Lafreniere
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!