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 #15 Feb 05 2017 06:43:50
%S 1,1,2,4,1,10,4,1,28,18,5,1,89,77,30,6,1,315,345,164,45,7,1,1233,1617,
%T 919,299,63,8,1,5285,8003,5262,2011,492,84,9,1,24583,41871,31180,
%U 13611,3857,754,108,10,1,123062,231474,191889,94020,30128,6755,1095,135,11,1
%N Number T(n,k) of set partitions of [n] having exactly k triples (t,t+1,t+2) such that t+i is in block b+i for some b; triangle T(n,k), n>=0, 0<=k<=max(0,n-2), read by rows.
%H Alois P. Heinz, <a href="/A271206/b271206.txt">Rows n = 0..100, flattened</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Partition_of_a_set">Partition of a set</a>
%e T(3,1) = 1: 1|2|3.
%e T(4,1) = 4: 12|3|4, 14|2|3, 1|24|3, 1|2|34.
%e T(5,1) = 18: 123|4|5, 125|3|4, 12|35|4, 12|3|45, 13|24|5, 1|23|4|5, 145|2|3, 14|25|3, 14|2|35, 14|2|3|5, 15|24|3, 1|245|3, 1|24|35, 1|24|3|5, 15|2|34, 1|25|34, 1|2|345, 1|2|34|5.
%e T(5,2) = 5: 12|3|4|5, 15|2|3|4, 1|25|3|4, 1|2|35|4, 1|2|3|45.
%e T(5,3) = 1: 1|2|3|4|5.
%e Triangle T(n,k) begins:
%e : 0 : 1;
%e : 1 : 1;
%e : 2 : 2;
%e : 3 : 4, 1;
%e : 4 : 10, 4, 1;
%e : 5 : 28, 18, 5, 1;
%e : 6 : 89, 77, 30, 6, 1;
%e : 7 : 315, 345, 164, 45, 7, 1;
%e : 8 : 1233, 1617, 919, 299, 63, 8, 1;
%e : 9 : 5285, 8003, 5262, 2011, 492, 84, 9, 1;
%e : 10 : 24583, 41871, 31180, 13611, 3857, 754, 108, 10, 1;
%p b:= proc(n, i, t, m) option remember; expand(`if`(n=0, 1, add((v->
%p `if`(t and v, x, 1)*b(n-1, j, v, max(m, j)))(j=i+1), j=1..m+1)))
%p end:
%p T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 1, false, 0)):
%p seq(T(n), n=0..14);
%t b[n_, i_, t_, m_] := b[n, i, t, m] = Expand[If[n==0, 1, Sum[Function[v, If[t && v, x, 1]*b[n-1, j, v, Max[m, j]]][j==i+1], {j, 1, m+1}]]]; T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, 1, False, 0]]; Table[T[n], {n, 0, 14}] // Flatten (* _Jean-François Alcover_, Feb 05 2017, translated from Maple *)
%Y Column k=0 gives A271207.
%Y Row sums give A000110.
%Y Cf. A185982.
%K nonn,tabf
%O 0,3
%A _Alois P. Heinz_, Apr 01 2016