%I
%S 1,1,2,5,1,16,8,61,59,272,438,10,1385,3445,210,7936,29080,3304,50521,
%T 264871,47208,280,353792,2605002,658806,11200,2702765,27634817,
%U 9275838,303380,22368256,315591124,134010580,7016240,15400,199360981,3870632947,2005021876,151003996,1001000
%N Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} having k cycles that are not updown. A cycle (b(1), b(2), ...) is said to be updown if, when written with its smallest element in the first position, it satisfies b(1)<b(2)>b(3)<... .
%C Row n contains 1 + floor(n/3) entries.
%C Sum of entries in row n is n!.
%C T(n,0)=A000111(n+1) (the Euler or updown numbers).
%C Sum(k*T(n,k),k>=0) = A186362(n).
%H Alois P. Heinz, <a href="/A186361/b186361.txt">Rows n = 0..200, flattened</a>
%H E. Deutsch and S. Elizalde, <a href="http://arxiv.org/abs/0909.5199v1"> Cycle updown permutations</a>, arXiv:0909.5199v1 [math.CO].
%F E.g.f.=(1sin z)^{s1}/(1z)^s.
%F The trivariate e.g.f. H(t,s,z) of the permutations of {1,2,...,n} with respect to size (marked by z), number of updown cycles (marked by t), and number of cycles that are not updown (marked by s) is given by H(t,s,z)=(1sin z)^{st}/(1z)^s.
%e T(3,1)=1 because we have (123).
%e T(4,1)=8 because we have (1432), (1)(234), (1342), (1243), (123)(4), (1234), (124)(3), and (134)(2).
%e Triangle starts:
%e 1;
%e 1;
%e 2;
%e 5, 1;
%e 16, 8;
%e 61, 59;
%e 272, 438, 10;
%e ...
%p G := (1sin(z))^(t1)/(1z)^t: Gser := simplify(series(G, z = 0, 16)): for n from 0 to 13 do P[n] := sort(expand(factorial(n)*coeff(Gser, z, n))) end do: for n from 0 to 13 do seq(coeff(P[n], t, j), j = 0 .. floor((1/3)*n)) end do; # yields sequence in triangular form
%p # second Maple program:
%p g:= proc(u, o) option remember;
%p `if`(u+o=0, 1, add(g(o1+j, uj), j=1..u))
%p end:
%p b:= proc(n) option remember; expand(`if`(n=0, 1, add(b(nj)*
%p binomial(n1, j1)*((j1)!*xg(j1, 0)*(x1)), j=1..n)))
%p end:
%p T:= n> (p> seq(coeff(p, x, i), i=0..degree(p)))(b(n)):
%p seq(T(n), n=0..14); # _Alois P. Heinz_, Apr 15 2017
%t g[u_, o_] := g[u, o] = If[u + o == 0, 1, Sum[g[o1+j, uj], {j, 1, u}]];
%t b[n_] := b[n] = Expand[If[n == 0, 1, Sum[b[n  j]*Binomial[n1, j1] * ((j  1)!*x  g[j  1, 0]*(x  1)), {j, 1, n}]]];
%t T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}] ][b[n]];
%t Table[T[n], {n, 0, 14}] // Flatten (* _JeanFrançois Alcover_, Nov 07 2017, after _Alois P. Heinz_ *)
%Y Cf. A000111, A186362, A186358.
%K nonn,tabf
%O 0,3
%A _Emeric Deutsch_, Feb 28 2011
