Identifier
- St001639: Permutations ⟶ ℤ
Values
[1] => 0
[1,2] => 0
[2,1] => 0
[1,2,3] => 0
[1,3,2] => 1
[2,1,3] => 1
[2,3,1] => 1
[3,1,2] => 1
[3,2,1] => 0
[1,2,3,4] => 0
[1,2,4,3] => 3
[1,3,2,4] => 2
[1,3,4,2] => 3
[1,4,2,3] => 3
[1,4,3,2] => 1
[2,1,3,4] => 3
[2,1,4,3] => 2
[2,3,1,4] => 3
[2,3,4,1] => 1
[2,4,1,3] => 4
[2,4,3,1] => 3
[3,1,2,4] => 3
[3,1,4,2] => 4
[3,2,1,4] => 1
[3,2,4,1] => 3
[3,4,1,2] => 2
[3,4,2,1] => 3
[4,1,2,3] => 1
[4,1,3,2] => 3
[4,2,1,3] => 3
[4,2,3,1] => 2
[4,3,1,2] => 3
[4,3,2,1] => 0
[1,2,3,4,5] => 0
[1,2,3,5,4] => 6
[1,2,4,3,5] => 5
[1,2,4,5,3] => 7
[1,2,5,3,4] => 7
[1,2,5,4,3] => 3
[1,3,2,4,5] => 5
[1,3,2,5,4] => 6
[1,3,4,2,5] => 6
[1,3,4,5,2] => 5
[1,3,5,2,4] => 9
[1,3,5,4,2] => 7
[1,4,2,3,5] => 6
[1,4,2,5,3] => 9
[1,4,3,2,5] => 2
[1,4,3,5,2] => 7
[1,4,5,2,3] => 4
[1,4,5,3,2] => 6
[1,5,2,3,4] => 5
[1,5,2,4,3] => 7
[1,5,3,2,4] => 7
[1,5,3,4,2] => 6
[1,5,4,2,3] => 6
[1,5,4,3,2] => 3
[2,1,3,4,5] => 6
[2,1,3,5,4] => 7
[2,1,4,3,5] => 6
[2,1,4,5,3] => 6
[2,1,5,3,4] => 6
[2,1,5,4,3] => 5
[2,3,1,4,5] => 7
[2,3,1,5,4] => 6
[2,3,4,1,5] => 5
[2,3,4,5,1] => 3
[2,3,5,1,4] => 7
[2,3,5,4,1] => 6
[2,4,1,3,5] => 9
[2,4,1,5,3] => 8
[2,4,3,1,5] => 7
[2,4,3,5,1] => 6
[2,4,5,1,3] => 7
[2,4,5,3,1] => 7
[2,5,1,3,4] => 7
[2,5,1,4,3] => 7
[2,5,3,1,4] => 9
[2,5,3,4,1] => 7
[2,5,4,1,3] => 7
[2,5,4,3,1] => 5
[3,1,2,4,5] => 7
[3,1,2,5,4] => 6
[3,1,4,2,5] => 9
[3,1,4,5,2] => 7
[3,1,5,2,4] => 8
[3,1,5,4,2] => 7
[3,2,1,4,5] => 3
[3,2,1,5,4] => 5
[3,2,4,1,5] => 7
[3,2,4,5,1] => 6
[3,2,5,1,4] => 7
[3,2,5,4,1] => 4
[3,4,1,2,5] => 4
[3,4,1,5,2] => 7
[3,4,2,1,5] => 6
[3,4,2,5,1] => 7
[3,4,5,1,2] => 5
[3,4,5,2,1] => 3
[3,5,1,2,4] => 7
[3,5,1,4,2] => 8
>>> 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 alternating subsets such that applying the permutation does not yield an alternating subset.
A subset of $[n]=\{1,\dots,n\}$ is alternating if any two successive elements have different parity. This statistic records for each permutation $\pi\in\mathfrak S_n$ the number of alternating subsets $S\subseteq [n]$ such that $\pi(S)$ is not alternating.
Note that the number of alternating subsets of $[n]$ is $F(n+3)-1$, where $F(n)$ is the $n$-th Fibonacci number.
A subset of $[n]=\{1,\dots,n\}$ is alternating if any two successive elements have different parity. This statistic records for each permutation $\pi\in\mathfrak S_n$ the number of alternating subsets $S\subseteq [n]$ such that $\pi(S)$ is not alternating.
Note that the number of alternating subsets of $[n]$ is $F(n+3)-1$, where $F(n)$ is the $n$-th Fibonacci number.
References
[1] Dawar, A. Counting sets whose alternation is preserved by a permutation MathOverflow:375868
Code
def is_alternating(S):
return all(is_odd(s + t) for s, t in zip(S, S[1:]))
@cached_function
def alternating_subsets(n):
return [S for S in Subsets(n) if (is_alternating(sorted(S)))]
def statistic(pi):
pi = Permutation(pi)
n = len(pi)
good = 0
for S in alternating_subsets(n):
if not is_alternating(sorted(pi(s) for s in S)):
good += 1
return good
Created
Nov 07, 2020 at 18:04 by Martin Rubey
Updated
Nov 07, 2020 at 18:04 by Martin Rubey
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!