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 #20 Dec 01 2017 17:41:57
%S 1,1,2,6,13,11,39,52,29,158,233,230,99,674,1344,1537,1118,367,3304,
%T 8197,11208,10200,5868,1543,19511,49846,89657,95624,67223,33118,7901,
%U 122706,351946,724755,907078,781827,492285,206444,41759,834131,2799536,6010150
%N Number T(n,k) of permutations of [n] with exactly k (possibly overlapping) occurrences of some of the consecutive step patterns UUD, UDU, DUU (U=up, D=down); triangle T(n,k), n>=0, 0<=k<=max(0,n-3), read by rows.
%H Alois P. Heinz, <a href="/A231384/b231384.txt">Rows n = 0..80, flattened</a>
%H A. Baxter, B. Nakamura, and D. Zeilberger, <a href="http://www.math.rutgers.edu/~zeilberg/mamarim/mamarimhtml/auto.html">Automatic generation of theorems and proofs on enumerating consecutive Wilf-classes</a>
%H S. Kitaev and T. Mansour, <a href="http://www.ru.is/kennarar/sergey/index_files/Papers/multi_avoid_gen_patterns.pdf">On multi-avoidance of generalized patterns</a>
%e T(4,1) = 11: 1243, 1342, 2341 (UUD), 1324, 1423, 2314, 2413, 3412 (UDU), 2134, 3124, 4123 (DUU).
%e T(5,0) = 39: 12345, 14325, 15324, ..., 54231, 54312, 54321.
%e T(5,1) = 52: 12354, 12453, 12543, ..., 53124, 53412, 54123.
%e T(5,2) = 29: 12435, 12534, 13245, ..., 51243, 51342, 52341.
%e Triangle T(n,k) begins:
%e : 0 : 1;
%e : 1 : 1;
%e : 2 : 2;
%e : 3 : 6;
%e : 4 : 13, 11;
%e : 5 : 39, 52, 29;
%e : 6 : 158, 233, 230, 99;
%e : 7 : 674, 1344, 1537, 1118, 367;
%e : 8 : 3304, 8197, 11208, 10200, 5868, 1543;
%e : 9 : 19511, 49846, 89657, 95624, 67223, 33118, 7901;
%p b:= proc(u, o, t) option remember; `if`(u+o=0, 1, expand(
%p add(b(u+j-1, o-j, [2, 3, 3, 6, 6, 3][t])*
%p `if`(t in [5, 6], x, 1), j=1..o)+
%p add(b(u-j, o+j-1, [4, 5, 5, 4, 4, 5][t])*
%p `if`(t=3, x, 1), j=1..u)))
%p end:
%p T:= n-> `if`(n=0, 1, (p-> seq(coeff(p, x, i), i=0..degree(p)))
%p (add(b(j-1, n-j, 1), j=1..n))):
%p seq(T(n), n=0..12);
%t b[u_, o_, t_] := b[u, o, t] = If[u+o == 0, 1, Expand[Sum[b[u+j-1, o-j, {2, 3, 3, 6, 6, 3}[[t]]]*If[t == 5 || t == 6, x, 1], {j, 1, o}] + Sum[b[u-j, o+j-1, {4, 5, 5, 4, 4, 5}[[t]]]*If[t == 3, x, 1], {j, 1, u}]]]; T[n_] := If[n == 0, 1, Function[{p}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][Sum[b[j-1, n-j, 1], {j, 1, n}]]]; Table[T[n], {n, 0, 12}] // Flatten (* _Jean-François Alcover_, Feb 05 2015, after _Alois P. Heinz_ *)
%Y Columns k=0-2 give: A231385, A231386, A228408.
%Y Diagonal gives: A231410.
%Y Row sums give: A000142.
%Y Cf. A295987.
%K nonn,tabf
%O 0,3
%A _Alois P. Heinz_, Nov 08 2013