A052882 A simple grammar: rooted ordered set partitions.
0, 1, 2, 9, 52, 375, 3246, 32781, 378344, 4912515, 70872610, 1124723193, 19471590876, 365190378735, 7376016877334, 159620144556645, 3684531055645648, 90366129593683035, 2346673806524446218, 64325158601880061137, 1856031746386568222660, 56231443721132068265415
Offset: 0
Examples
G.f. = x + 2*x^2 + 9*x^3 + 52*x^4 + 375*x^5 + 3246*x^6 + 32781*x^7 + ...
References
- S. Ramanujan, Notebooks, Tata Institute of Fundamental Research, Bombay 1957 Vol. 1, see page 19.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..200
- Samuele Giraudo, Combinatorial operads from monoids, arXiv preprint arXiv:1306.6938 [math.CO], 2013.
- Jia Huang and Erkko Lehtonen, Associative-commutative spectra for some varieties of groupoids, arXiv:2401.15786 [math.CO], 2024. See p. 14.
- INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 855
- Srinivasa Ramanujan, Notebook entry
Programs
-
Maple
spec := [S,{C=Sequence(B),B=Set(Z,1 <= card),S=Prod(Z,C)},labeled]: seq(combstruct[count](spec,size=n), n=0..20); with(combinat): a:=n-> add(add(add((-1)^(k-i)*binomial(k, i)*i^(n-1), i=0..n-1), k=0..n-1), m=0..n-1): seq(a(n), n=0..20); # Zerinvary Lajos, Jun 03 2007 # next Maple program: b:= proc(n, k) option remember; `if`(n<1, k!, k*b(n-1, k)+b(n-1, k+1)) end: a:= n-> b(n-1, 0)*n: seq(a(n), n=0..25); # Alois P. Heinz, Apr 15 2023
-
Mathematica
a[1] := 1; a[n_] := a[n]=Sum[ Binomial[n, m] a[ n-m], {m, 1, n-1}] Range[0, 30]!* CoefficientList[Series[x/(2 - Exp[x]),{x, 0, 30}], x] (* Vincenzo Librandi, Dec 06 2012 *) a[ n_] := If[ n < 2, Boole[n == 1], n PolyLog[ 1 - n, 1/2] / 2]; (* Michael Somos, Jun 19 2015 *) a[ n_] := If[ n < 0, 0, n! SeriesCoefficient[ x / (2 - Exp@x), {x, 0, n}]]; (* Michael Somos, Jun 19 2015 *) Fubini[n_, r_] := Sum[k!*Sum[(-1)^(i+k+r)*(i+r)^(n-r)/(i!*(k-i-r)!), {i, 0, k-r}], {k, r, n}]; Fubini[0, 1] = 1; a[n_] := n*Fubini[n-1, 1]; Table[ a[n], {n, 0, 18}] (* Jean-François Alcover, Mar 30 2016 *)
-
PARI
{a(n) = if( n<0, 0, n! * polcoeff( subst( x / (1 - y), y, exp(x + x*O(x^n)) - 1), n))};
-
Python
from math import factorial from sympy.functions.combinatorial.numbers import stirling def A052882(n): return n*sum(factorial(k)*stirling(n-1,k) for k in range(n)) # Chai Wah Wu, Apr 15 2023
Formula
E.g.f.: x / (2 - exp(x)).
a(n) = n * A000670(n-1) if n>0.
a(n) = (1/2)*sum(k=0, n-1, B_k*A000629(k)*binomial(n, k)) where B_k is the k-th Bernoulli number. - Benoit Cloitre, Oct 19 2005
a(n) ~ n!/(2*(log(2))^n). - Vaclav Kotesovec, Aug 09 2013
a(0) = 0, a(1) = 1; a(n) = n! * [x^n] exp(x)*Sum_{k=1..n-1} a(k)*x^k/k!. - Ilya Gutkovskiy, Oct 17 2017
Comments