%I #19 Oct 11 2019 03:02:45
%S 0,1,0,1,2,0,0,6,6,0,0,12,36,12,0,1,29,147,155,28,0,1,64,586,1208,605,
%T 56,0,0,120,2160,7800,7800,2160,120,0,0,240,7320,44160,78000,44160,
%U 7320,240,0,1,517,23893,227569,655315,655039,227623,23947,496,0,1,1044,76332,1101420,4869558,7862124,4868556,1102068,76305,992,0
%N Triangle T(n,k) read by rows: number of permutations in [n] with exactly k ascents that have an odd number of inversions.
%H Alois P. Heinz, <a href="/A128613/b128613.txt">Rows n = 1..141, flattened</a>
%H Jason Fulman, Gene B. Kim, Sangchul Lee, T. Kyle Petersen, <a href="https://arxiv.org/abs/1910.04258">On the joint distribution of descents and signs of permutations</a>, arXiv:1910.04258 [math.CO], 2019.
%H S. Tanimoto, <a href="http://arXiv.org/abs/math.CO/0602263">A new approach to signed Eulerian numbers</a>, arXiv:math/0602263 [math.CO], 2006.
%F a(n) = 1/2 * [A008292(n,k) - A049061(n,k) ].
%F T(n,k) = 1/2 * [A008292(n,n-k)-A049061(n,n-k)], n>=1, 0<=k<n. - _R. J. Mathar_, Nov 01 2007
%e Triangle starts:
%e 0;
%e 1,0;
%e 1,2,0;
%e 0,6,6,0;
%e 0,12,36,12,0;
%e 1,29,147,155,28,0;
%e 1,64,586,120,605,56,0;
%e 0,120,2160,7800,7800,2160,120,0;
%p A008292 := proc(n,k) local j; add( (-1)^j*(k-j)^n*binomial(n+1,j),j=0..k) ; end: A049061 := proc(n,k) if k <= 0 or n <=0 or k > n then 0; elif n = 1 then 1 ; elif n mod 2 = 0 then A049061(n-1,k)-A049061(n-1,k-1) ; else k*A049061(n-1,k)+(n-k+1)*A049061(n-1,k-1) ; fi ; end: A128613 := proc(n,k) (A008292(n,n-k)-A049061(n,n-k))/2 ; end: for n from 1 to 11 do for k from 0 to n-1 do printf("%d,",A128613(n,k)) ; od: od: # _R. J. Mathar_, Nov 01 2007
%p # second Maple program:
%p b:= proc(u, o, i) option remember; expand(`if`(u+o=0, i,
%p add(b(u+j-1, o-j, irem(i+u+j-1, 2)), j=1..o)*x+
%p add(b(u-j, o+j-1, irem(i+u-j, 2)), j=1..u)))
%p end:
%p T:= n-> (p-> seq(coeff(p, x, i), i=0..n-1))(b(n, 0$2)):
%p seq(T(n), n=1..14); # _Alois P. Heinz_, May 02 2017
%t b[u_, o_, i_] := b[u, o, i] = Expand[If[u + o == 0, i, Sum[b[u + j - 1, o - j, Mod[i + u + j - 1, 2]], {j, 1, o}]*x + Sum[b[u - j, o + j - 1, Mod[i + u - j, 2]], {j, 1, u}]]];
%t T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, n-1}]][b[n, 0,0]];
%t Table[T[n], {n, 1, 14}] // Flatten (* _Jean-François Alcover_, Jul 25 2017, after _Alois P. Heinz_ *)
%Y Cf. A008292, A049061, A128612.
%K nonn,tabl
%O 1,5
%A _Ralf Stephan_, May 08 2007
%E Corrected and extended by _R. J. Mathar_, Nov 01 2007