Identifier
Identifier
Values
[1] => 0
[-1] => 0
[1,2] => 0
[1,-2] => 1
[-1,2] => 0
[-1,-2] => 1
[2,1] => 0
[2,-1] => 0
[-2,1] => 1
[-2,-1] => 1
[1,2,3] => 0
[1,2,-3] => 2
[1,-2,3] => 1
[1,-2,-3] => 3
[-1,2,3] => 0
[-1,2,-3] => 2
[-1,-2,3] => 1
[-1,-2,-3] => 3
[1,3,2] => 0
[1,3,-2] => 1
[1,-3,2] => 2
[1,-3,-2] => 3
[-1,3,2] => 0
[-1,3,-2] => 1
[-1,-3,2] => 2
[-1,-3,-2] => 3
[2,1,3] => 0
[2,1,-3] => 2
[2,-1,3] => 0
[2,-1,-3] => 2
[-2,1,3] => 1
[-2,1,-3] => 3
[-2,-1,3] => 1
[-2,-1,-3] => 3
[2,3,1] => 0
[2,3,-1] => 0
[2,-3,1] => 2
[2,-3,-1] => 2
[-2,3,1] => 1
[-2,3,-1] => 1
[-2,-3,1] => 3
[-2,-3,-1] => 3
[3,1,2] => 0
[3,1,-2] => 1
[3,-1,2] => 0
[3,-1,-2] => 1
[-3,1,2] => 2
[-3,1,-2] => 3
[-3,-1,2] => 2
[-3,-1,-2] => 3
[3,2,1] => 0
[3,2,-1] => 0
[3,-2,1] => 1
[3,-2,-1] => 1
[-3,2,1] => 2
[-3,2,-1] => 2
[-3,-2,1] => 3
[-3,-2,-1] => 3
click to show generating function       
Description
The number of negative sum pairs of a signed permutation.
The number of negative sum pairs of a signed permutation $\sigma$ is:
$$\operatorname{nsp}(\sigma)=\big|\{1\leq i < j\leq n \mid \sigma(i)+\sigma(j) < 0\}\big|,$$
see [1, Eq.(8.1)].
References
[1] Björner, A., Brenti, F. Combinatorics of Coxeter groups MathSciNet:2133266
Code
def statistic(pi):
    pi = list(pi)
    n = len(pi)
    return sum(1 for i in range(n) for j in range(i+1,n) if pi[i] + pi[j]<0)

Created
Jun 24, 2019 at 14:12 by Angela Carnevale
Updated
Jun 24, 2019 at 14:12 by Angela Carnevale