%I #31 Nov 08 2017 10:29:09
%S 1,0,1,1,1,4,5,11,28,5,41,153,71,162,872,759,61,715,5191,7262,1665,
%T 3425,32398,66510,29778,1385,17722,211937,601080,443231,60991,98253,
%U 1451599,5446847,5994473,1642877,50521,580317,10393114,49940615,76889330,35162440,3249025
%N Triangle read by rows, arising in enumeration of permutations by cyclic peaks, cycles and fixed points.
%C See Ma and Chow (2012) for precise definition (cf. Proposition 3).
%H Alois P. Heinz, <a href="/A216963/b216963.txt">Rows n = 0..200, flattened</a>
%H Shi-Mei Ma and Chak-On Chow, <a href="https://arxiv.org/abs/1203.6264">Enumeration of permutations by number of cyclic peaks and cyclic valleys</a>, arXiv preprint arXiv:1203.6264 [math.CO], 2012.
%e Triangle begins:
%e : 1;
%e : 0;
%e : 1;
%e : 1, 1;
%e : 4, 5;
%e : 11, 28, 5;
%e : 41, 153, 71;
%e : 162, 872, 759, 61;
%e : 715, 5191, 7262, 1665;
%e ...
%p p:= proc(n) option remember; expand(`if`(n<4,
%p [1, 0, x, x*(1+q)][n+1], (n-1)*q*p(n-1)+
%p 2*q*(1-q)*diff(p(n-1), q)+x*(1-q)*
%p diff(p(n-1), x)+(n-1)*x*p(n-2)))
%p end:
%p T:= n-> (t-> seq(coeff(t, q, i), i=0..
%p max(0, degree(t))))(subs(x=1, p(n))):
%p seq(T(n), n=0..15); # _Alois P. Heinz_, Apr 13 2017
%t p[0] = 1; p[1] = 0; p[2] = x; p[3] = (1 + q) x;
%t p[n_] := p[n] = Expand[(n - 1) q p[n - 1] + 2 q (1 - q) D[p[n - 1], q] + x (1 - q) D[p[n - 1], x] + (n - 1) x p[n - 2]];
%t T[n_] := CoefficientList[p[n] /. x -> 1 , q]; T[1] = {0};
%t Table[T[n], {n, 0, 15}] // Flatten (* _Jean-François Alcover_, Nov 08 2017 *)
%o (PARI) tabf(m) = {P = x; M = subst(P, x, 1); for (d=0, poldegree(M, q), print1(polcoeff(M, d, q), ", "); ); print(""); Q = (1+q)*x; M = subst(Q, x, 1); for (d=0, poldegree(M, q), print1(polcoeff(M, d, q), ", "); ); print(""); for (n=3, m, newP = n*q*Q + 2*q*(1-q)*deriv(Q,q) + x*(1-q)*deriv(Q,x) + n*x*P; M = subst(newP, x, 1); for (d=0, poldegree(M, q), print1(polcoeff(M, d, q), ", "); ); print(""); P = Q; Q = newP;);} \\ _Michel Marcus_, Feb 09 2013
%Y Column k=0 gives A000296.
%Y Row sums give A000166.
%Y T(2n+1,n) gives A000364(n) for n>0.
%K nonn,tabf
%O 0,6
%A _N. J. A. Sloane_, Sep 27 2012
%E More terms from _Michel Marcus_, Feb 09 2013
%E One row for T(0,0)=1 prepended by _Alois P. Heinz_, Apr 13 2017