OFFSET
3,2
LINKS
Augustine O. Munagi, Set Partitions with Successions and Separations, Int. J. Math and Math. Sc. 2005:3 (2005), 451-463.
FORMULA
a(n) = Sum_{k=1..n} c(n, k, 1), where c(n, k, 1) is the case r=1 of c(n, k, r) given by c(n, k, r)=c(n-1, k-1, r)+(k-1)c(n-1, k, r)+c(n-2, k-1, r)+(k-1)c(n-2, k, r)+c(n-1, k, r-1)-c(n-2, k-1, r-1)-(k-1)c(n-2, k, r-1), r=0, 1, .., n-k-1, k=1, 2, .., n-2r, c(n, k, 0) = Sum_{0..floor(n/2)} binomial(n-j, j)*S2(n-j-1, k-1).
EXAMPLE
a(5) = 8 because the partitions of {1,2,3,4,5} with one 3-string of consecutive integers are 1235/4, 1345/2, 15/234, 123/45, 12/345, 123/4/5, 1/234/5, 1/2/345.
MAPLE
c := proc(n, k, r) option remember ; local j ; if r =0 then add(binomial(n-j, j)*combinat[stirling2](n-j-1, k-1), j=0..floor(n/2)) ; else if r <0 or r > n-k-1 then RETURN(0) fi ; if n <1 then RETURN(0) fi ; if k <1 then RETURN(0) fi ; RETURN( c(n-1, k-1, r)+(k-1)*c(n-1, k, r)+c(n-2, k-1, r)+(k-1)*c(n-2, k, r) +c(n-1, k, r-1)-c(n-2, k-1, r-1)-(k-1)*c(n-2, k, r-1) ) ; fi ; end: A105483 := proc(n) local k ; add(c(n, k, 1), k=1..n) ; end: for n from 3 to 26 do printf("%d, ", A105483(n)) ; od ; # R. J. Mathar, Feb 20 2007
MATHEMATICA
S2[_, -1] = 0;
S2[n_, k_] = StirlingS2[n, k];
c [n_, k_, r_] := c[n, k, r] = Which[r == 0, Sum[Binomial[n - j, j]*S2[n - j - 1, k - 1], {j, 0, Floor[n/2]}], r < 0 || r > n - k - 1, 0, n < 1, 0, k < 1, 0, True, c[n - 1, k - 1, r] + (k - 1)*c[n - 1, k, r] + c[n - 2, k - 1, r] + (k - 1)*c[n - 2, k, r] + c[n - 1, k, r - 1] - c[n - 2, k - 1, r - 1] - (k - 1)*c[n - 2, k, r - 1]];
A105483[n_] := Sum[c[n, k, 1], {k, 1, n}];
CROSSREFS
KEYWORD
nonn
AUTHOR
Augustine O. Munagi, Apr 10 2005
EXTENSIONS
More terms from R. J. Mathar, Feb 20 2007
STATUS
approved