cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A287416 Number T(n,k) of set partitions of [n] such that the maximal value of all absolute differences between least elements of consecutive blocks and between consecutive elements within the blocks equals k; triangle T(n,k), n>=0, 0<=k<=max(n-1,0), read by rows.

This page as a plain text file.
%I A287416 #28 Jan 06 2022 14:28:01
%S A287416 1,1,0,2,0,3,2,0,4,8,3,0,5,22,19,6,0,6,52,81,48,16,0,7,114,289,267,
%T A287416 147,53,0,8,240,941,1250,968,529,204,0,9,494,2894,5310,5469,3919,2174,
%U A287416 878,0,10,1004,8601,21256,28083,25326,17593,9961,4141
%N A287416 Number T(n,k) of set partitions of [n] such that the maximal value of all absolute differences between least elements of consecutive blocks and between consecutive elements within the blocks equals k; triangle T(n,k), n>=0, 0<=k<=max(n-1,0), read by rows.
%C A287416 The maximal value is assumed to be zero if there are no consecutive blocks and no consecutive elements.
%C A287416 T(n,k) is defined for all n,k >= 0. The triangle contains only the terms for k <= max(n-1,0). T(n,k) = 0 if k>=n and k>0.
%H A287416 Alois P. Heinz, <a href="/A287416/b287416.txt">Rows n = 0..23, flattened</a>
%H A287416 Wikipedia, <a href="https://en.wikipedia.org/wiki/Partition_of_a_set">Partition of a set</a>
%F A287416 T(n,k) = A287417(n,k) - A287417(n,k-1) for k>0, T(n,0) = 1.
%F A287416 T(n+2,n+1) = 1 + A000110(n).
%e A287416 T(4,1) = 4: 1234, 1|234, 1|2|34, 1|2|3|4.
%e A287416 T(4,2) = 8: 124|3, 12|34, 12|3|4, 134|2, 13|24, 13|2|4, 1|23|4, 1|24|3.
%e A287416 T(4,3) = 3: 123|4, 14|23, 14|2|3.
%e A287416 T(5,3) = 19: 1235|4, 123|45, 123|4|5, 125|34, 125|3|4, 134|25, 134|2|5, 13|24|5, 13|25|4, 145|23, 14|235, 14|23|5, 1|234|5, 145|2|3, 14|25|3, 14|2|35, 14|2|3|5, 1|25|34, 1|25|3|4.
%e A287416 Triangle T(n,k) begins:
%e A287416   1;
%e A287416   1;
%e A287416   0, 2;
%e A287416   0, 3,   2;
%e A287416   0, 4,   8,   3;
%e A287416   0, 5,  22,  19,    6;
%e A287416   0, 6,  52,  81,   48,  16;
%e A287416   0, 7, 114, 289,  267, 147,  53;
%e A287416   0, 8, 240, 941, 1250, 968, 529, 204;
%e A287416   ...
%p A287416 b:= proc(n, k, l, t) option remember; `if`(n<1, 1, `if`(t-n>k, 0,
%p A287416        b(n-1, k, map(x-> `if`(x-n>=k, [][], x), [l[], n]), n)) +add(
%p A287416        b(n-1, k, sort(map(x-> `if`(x-n>=k, [][], x), subsop(j=n, l))),
%p A287416        `if`(t-n>k, infinity, t)), j=1..nops(l)))
%p A287416     end:
%p A287416 A:= (n, k)-> b(n, min(k, n-1), [], n):
%p A287416 T:= (n, k)-> A(n, k)-`if`(k=0, 0, A(n, k-1)):
%p A287416 seq(seq(T(n, k), k=0..max(n-1, 0)), n=0..12);
%t A287416 b[n_, k_, l_, t_] := b[n, k, l, t] = If[n < 1, 1, If[t - n > k, 0, b[n - 1, k, If[# - n >= k, Nothing, #]& /@ Append[l, n], n]] + Sum[b[n - 1, k, Sort[If[# - n >= k, Nothing, #]& /@ ReplacePart[l, j -> n]], If[t - n > k, Infinity, t]], {j, 1, Length[l]}]];
%t A287416 A[n_, k_] := b[n, Min[k, n - 1], {}, n];
%t A287416 T[n_, k_] := A[n, k] - If[k == 0, 0, A[n, k - 1]];
%t A287416 Table[T[n, k], {n, 0, 12}, { k, 0, Max[n - 1, 0]}] // Flatten (* _Jean-François Alcover_, May 24 2018, translated from Maple *)
%Y A287416 Columns k=1-2 give: A001477 (for n>1), A005803 (for n>0).
%Y A287416 Row sums give A000110.
%Y A287416 Cf. A287213, A287215, A287417, A287640.
%K A287416 nonn,tabf
%O A287416 0,4
%A A287416 _Alois P. Heinz_, May 24 2017