%I #28 Feb 22 2024 20:26:44
%S 1,0,1,1,0,1,0,5,0,1,6,0,17,0,1,0,70,0,49,0,1,90,0,500,0,129,0,1,0,
%T 1890,0,2828,0,321,0,1,2520,0,23100,0,13930,0,769,0,1,0,83160,0,
%U 215292,0,62634,0,1793,0,1,113400,0,1549800,0,1697430,0,264072,0,4097,0,1
%N Triangle read by rows: T(n,k) is the number of permutations of [n] with exactly k increasing runs of odd length.
%H Alois P. Heinz, <a href="/A097591/b097591.txt">Rows n = 0..140, flattened</a>
%F E.g.f.: t^2/[1-tx-(1-t^2)exp(-tx)].
%F Sum_{k=1..n} k * T(n,k) = A096654(n-1) for n > 0. - _Alois P. Heinz_, Jul 03 2019
%e Triangle starts:
%e 1;
%e 0, 1;
%e 1, 0, 1;
%e 0, 5, 0, 1;
%e 6, 0, 17, 0, 1;
%e 0, 70, 0, 49, 0, 1;
%e 90, 0, 500, 0, 129, 0, 1;
%e 0, 1890, 0, 2828, 0, 321, 0, 1;
%e 2520, 0, 23100, 0, 13930, 0, 769, 0, 1;
%e ...
%e Row n has n+1 entries.
%e Example: T(3,1) = 5 because we have (123), 13(2), (2)13, 23(1) and (3)12 (the runs of odd length are shown between parentheses).
%p G:=t^2/(1-t*x-(1-t^2)*exp(-t*x)): Gser:=simplify(series(G,x=0,12)): P[0]:=1: for n from 1 to 11 do P[n]:=sort(expand(n!*coeff(Gser,x^n))) od: seq(seq(coeff(t*P[n],t^k),k=1..n+1),n=0..11);
%p # second Maple program:
%p b:= proc(u, o, t) option remember; `if`(u+o=0, x^t, expand(
%p add(b(u+j-1, o-j, irem(t+1, 2)), j=1..o)+
%p add(b(u-j, o+j-1, 1)*x^t, j=1..u)))
%p end:
%p T:= n-> (p-> seq(coeff(p, x, i), i=1..degree(p)))(b(n, 0, 1)):
%p seq(T(n), n=0..12); # _Alois P. Heinz_, Nov 19 2013
%t b[u_, o_, t_] := b[u, o, t] = If[u+o == 0, x^t, Expand[Sum[b[u+j-1, o-j, Mod[t+1, 2]], {j, 1, o}] + Sum[b[u-j, o+j-1, 1]*x^t, {j, 1, u}]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i], {i, 1, Exponent[p, x]}]][b[n, 0, 1]]; Table[T[n], {n, 0, 12}] // Flatten (* _Jean-François Alcover_, Feb 19 2015, after _Alois P. Heinz_ *)
%Y Bisections of columns k=0-1 give: A000680, A302910.
%Y Row sums give A000142.
%Y T(n+1,n-1) gives A000337.
%Y T(4n,2n) gives A308962.
%Y Cf. A096654, A097592.
%K nonn,tabl
%O 0,8
%A _Emeric Deutsch_, Aug 29 2004