OFFSET
0,5
COMMENTS
From Gus Wiseman, Jan 08 2019: (Start)
Also the number of set partitions of {1,...,n} into blocks of sizes > 1 whose minima form an initial interval of positive integers. For example, the a(5) = 7 set partitions are:
{{1,2,3,4,5}}
{{1,3},{2,4,5}}
{{1,4},{2,3,5}}
{{1,5},{2,3,4}}
{{1,3,4},{2,5}}
{{1,3,5},{2,4}}
{{1,4,5},{2,3}}
Also the number of ordered set partitions of {1,...,n-k} of length k, for any 0 <= k <= n. For example, the a(5) = 7 ordered set partitions are:
{{1,2,3,4}}
{{1},{2,3}}
{{2},{1,3}}
{{3},{1,2}}
{{1,2},{3}}
{{1,3},{2}}
{{2,3},{1}}
(End)
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..599
Giulio Cerbai, Pattern-avoiding modified ascent sequences, arXiv:2401.10027 [math.CO], 2024. See p. 13.
FORMULA
a(n) = sum{k=0..floor(n/2), sum{(-1)^i*binomial(k, i)*(k-i)^(n-k)}}.
E.g.f.: Sum_{n>=0} Integral^n (exp(x) - 1)^n dx^n, where integral^n F(x) dx^n is the n-th integration of F(x) with no constant of integration. - Paul D. Hanna, Dec 28 2013
Formal o.g.f.: 1/(1 + x)*sum {n >= 0} 1/(1 - n*x)*(x/(1 + x))^n = 1 + x^2 + x^3 + 3*x^4 + 7*x^5 + .... Cf. A229046. - Peter Bala, Jul 09 2014
EXAMPLE
a(8) = 1!*Stirling2(7,1) + 2!*Stirling2(6,2) + 3!*Stirling2(5,3) + 4!*Stirling2(4,4) = 1 + 62 + 150 + 24 = 237. - Peter Bala, Jul 09 2014
MAPLE
a:= n-> add(Stirling2(n-k, k)*k!, k=0..n/2):
seq(a(n), n=0..30); # Alois P. Heinz, Jul 09 2014
MATHEMATICA
Table[Sum[StirlingS2[n-k, k]*k!, {k, 0, n/2}], {n, 0, 20}] (* Vaclav Kotesovec, Jul 16 2014 *)
sps[{}]:={{}}; sps[set:{i_, ___}]:=Join@@Function[s, Prepend[#, s]&/@sps[Complement[set, s]]]/@Cases[Subsets[set], {i, ___}];
Table[Sum[Length[Join@@Permutations/@Select[sps[Range[n-k]], Length[#]==k&]], {k, 0, n}], {n, 0, 10}] (* Gus Wiseman, Jan 08 2019 *)
PROG
(PARI) /* From Paul Barry's formula: */
{a(n)=sum(k=0, floor(n/2), sum(i=0, k, (-1)^i*binomial(k, i)*(k-i)^(n-k)))} \\ Paul D. Hanna, Dec 28 2013
for(n=0, 30, print1(a(n), ", "))
(PARI) /* From e.g.f. series involving iterated integration: */
{INTEGRATE(n, F)=local(G=F); for(i=1, n, G=intformal(G)); G}
{a(n)=local(A=1+x); A=1+sum(k=1, n, INTEGRATE(k, (exp(x+x*O(x^n))-1)^k )); n!*polcoeff(A, n)} \\ Paul D. Hanna, Dec 28 2013
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Apr 20 2005
STATUS
approved