Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #27 Dec 19 2020 02:29:12
%S 1,1,0,2,3,3,12,4,8,35,45,40,144,348,132,96,910,1862,1316,952,5976,
%T 11600,14808,5760,2176,39942,100260,123606,63360,35712,306570,919270,
%U 1069910,910650,343040,79360,2698223,8427243,11694397,10673641,4477440,1945856
%N Number T(n,k) of permutations of [n] with exactly k (possibly overlapping, cyclic wrap-around) occurrences of the consecutive step pattern UDU (U=up, D=down); triangle T(n,k), n>=0, 0<=k<=floor(n/2), read by rows.
%H Alois P. Heinz, <a href="/A232933/b232933.txt">Rows n = 0..200, flattened</a>
%e T(2,1) = 2: 12, 21 (the two U's of UDU overlap).
%e T(3,0) = 3: 132, 213, 321.
%e T(3,1) = 3: 123, 231, 312.
%e T(4,0) = 12: 1243, 1342, 1432, 2134, 2143, 2431, 3124, 3214, 3421, 4213, 4312, 4321.
%e T(4,1) = 4: 1234, 2341, 3412, 4123.
%e T(4,2) = 8: 1324, 1423, 2314, 2413, 3142, 3241, 4132, 4231.
%e Triangle T(n,k) begins:
%e : 0 : 1;
%e : 1 : 1;
%e : 2 : 0, 2;
%e : 3 : 3, 3;
%e : 4 : 12, 4, 8;
%e : 5 : 35, 45, 40;
%e : 6 : 144, 348, 132, 96;
%e : 7 : 910, 1862, 1316, 952;
%e : 8 : 5976, 11600, 14808, 5760, 2176;
%e : 9 : 39942, 100260, 123606, 63360, 35712;
%e : 10 : 306570, 919270, 1069910, 910650, 343040, 79360;
%p b:= proc(u, o, t) option remember; `if`(u+o=0,
%p `if`(t=2, x, 1), expand(
%p add(b(u+j-1, o-j, 2)*`if`(t=3, x, 1), j=1..o)+
%p add(b(u-j, o+j-1, `if`(t=2, 3, 1)), j=1..u)))
%p end:
%p T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))
%p (`if`(n<2, 1, n* b(0, n-1, 1))):
%p seq(T(n), n=0..12);
%t b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, If[t == 2, x, 1], Expand[Sum[ b[u + j - 1, o - j, 2]*If[t == 3, x, 1], {j, 1, o}] + Sum[b[u - j, o + j - 1, If[t == 2, 3, 1]], {j, 1, u}]]];
%t T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]] [If[n < 2, 1, n*b[0, n - 1, 1]]];
%t T /@ Range[0, 12] // Flatten (* _Jean-François Alcover_, Dec 19 2020, after _Alois P. Heinz_ *)
%Y Column k=0 gives A232899.
%Y Row sums give A000142.
%Y T(2n,n) gives A009752(n) = 2n * A000182(n) for n>0.
%Y T(2n+1,n) gives (2n+1) * A024283(n) for n>0.
%Y Cf. A295987.
%K nonn,tabf
%O 0,4
%A _Alois P. Heinz_, Dec 02 2013