A287252 Number of set partitions of [n] such that all absolute differences between least elements of consecutive blocks are <= two.
1, 1, 2, 5, 14, 44, 152, 571, 2317, 10096, 47013, 232944, 1223428, 6786936, 39640947, 243060305, 1560340480, 10461611439, 73094563140, 531127372268, 4006242743228, 31316162403165, 253292622192153, 2116823651781702, 18255325000268015, 162261535224570326
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..590
- Wikipedia, Partition of a set
Programs
-
Maple
b:= proc(n, k, m, l) option remember; `if`(n<1, 1, `if`(l-n>k, 0, b(n-1, k, m+1, n))+m*b(n-1, k, m, l)) end: a:= n-> b(n-1, min(2, n-1), 1, n): seq(a(n), n=0..30);
-
Mathematica
b[n_, k_, m_, l_] := b[n, k, m, l] = If[n < 1, 1, If[l - n > k, 0, b[n - 1, k, m + 1, n]] + m*b[n - 1, k, m, l]]; a[n_] := b[n - 1, Min[2, n - 1], 1, n]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, May 28 2018, from Maple *)