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.

Showing 1-10 of 19 results. Next

A250105 Column 1 of triangle in A250104 (or A124323).

Original entry on oeis.org

0, 0, 3, 4, 20, 66, 287, 1296, 6435, 34250, 194942, 1179036, 7544121, 50865920, 360167355, 2670210640, 20673196460, 166753291806, 1398415162703, 12169520162440, 109709590135635, 1022997624845614, 9852508254721222, 97880299543896216, 1001841501018883425
Offset: 1

Views

Author

N. J. A. Sloane, Nov 16 2014

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := n*(Sum[(-1)^(j-1)*BellB[n-j-1], {j, 1, n-1}]-(-1)^n); a[1] = 0; Table[a[n], {n, 1, 25}] (* Jean-François Alcover, Dec 09 2014 *)

A250107 Column 3 of triangle in A250104 (or A124323).

Original entry on oeis.org

1, 0, 10, 20, 140, 616, 3444, 19440, 117975, 753500, 5068492, 35764092, 264044235, 2034636800, 16327586760, 136180742640, 1178372198220, 10561041814380, 97889061389210, 937053052507880, 9252175434771885, 94115781485796488, 985250825472122200
Offset: 3

Views

Author

N. J. A. Sloane, Nov 16 2014

Keywords

Crossrefs

Programs

  • Maple
    A250107 := proc(n)
        A124323(n,3) ;
    end proc:
    seq(A250107(n),n=3..50) ; # R. J. Mathar, Jan 22 2015
  • Mathematica
    t[0, 0] = 0; t[1, 0] = 1; t[1, 1] = 0;
    t[n_, k_] := Binomial[n, k] ((-1)^(n-k) + Sum[(-1)^(j-1) BellB[n-k-j], {j, 1, n-k}]);
    Table[t[n, 3], {n, 3, 25}] (* Jean-François Alcover, Mar 30 2020 *)

A211350 Refined triangle A124323: T(n,k) is the number of partitions of an n-set that are of type k (k-th integer partition, defined by A194602).

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 6, 4, 3, 1, 1, 10, 10, 15, 5, 10, 1, 1, 15, 20, 45, 15, 60, 6, 15, 15, 10, 1, 1, 21, 35, 105, 35, 210, 21, 105, 105, 70, 7, 105, 21, 35, 1, 1, 28, 56, 210, 70, 560, 56, 420, 420, 280, 28, 840, 168, 280, 8, 105, 210, 280, 28
Offset: 1

Views

Author

Tilman Piesk, Apr 09 2012

Keywords

Comments

Name could also be "Triangle of multinomial coefficients, read by rows (version 4)", compare A036040, A080575, A178867. The latter and this one differ only in the order of columns.
The rows are counted from 1, the columns from 0.
Row lengths: 1,2,3,5,7,11... (partition numbers A000041)
Row sums: 1,2,5,15,52,203... (Bell numbers A000110)
Row maxima: 1,1,3,6,15,60,210,840,3780,12600,69300,415800... (A102356)
Distinct entries per row: 1,1,2,4,4,7,7,13,17,23,26,40... (A102465)
Rightmost columns are those from Pascal's triangle A007318 without the second one (i.e. triangle A184049). The other columns - (always?) without a 1 at the top - are multiples of these columns from Pascal's triangle; so actually only the top elements of each column are needed to calculate the other entries; these top elements are in A211360. (The top elements of the related triangle A178867 are in A178866.)

Crossrefs

A250106 Column 2 of triangle in A250104 (or A124323).

Original entry on oeis.org

1, 0, 6, 10, 60, 231, 1148, 5832, 32175, 188375, 1169652, 7663734, 52808847, 381494400, 2881338840, 22696790440, 186058768140, 1584156272157, 13984151627030, 127779961705620, 1206805491491985, 11764472685724561, 118230099056654664
Offset: 2

Views

Author

N. J. A. Sloane, Nov 16 2014

Keywords

Crossrefs

Programs

A000296 Set partitions without singletons: number of partitions of an n-set into blocks of size > 1. Also number of cyclically spaced (or feasible) partitions.

Original entry on oeis.org

1, 0, 1, 1, 4, 11, 41, 162, 715, 3425, 17722, 98253, 580317, 3633280, 24011157, 166888165, 1216070380, 9264071767, 73600798037, 608476008122, 5224266196935, 46499892038437, 428369924118314, 4078345814329009, 40073660040755337, 405885209254049952, 4232705122975949401
Offset: 0

Views

Author

Keywords

Comments

a(n+2) = p(n+1) where p(x) is the unique degree-n polynomial such that p(k) = A000110(k) for k = 0, 1, ..., n. - Michael Somos, Oct 07 2003
Number of complete rhyming schemes.
Whereas the Bell number B(n) (A000110(n)) is the number of terms in the polynomial that expresses the n-th moment of a probability distribution as a function of the first n cumulants, these numbers give the number of terms in the corresponding expansion of the central moment as a function of the first n cumulants. - Michael Hardy (hardy(AT)math.umn.edu), Jan 26 2005
a(n) is the number of permutations on [n] for which the left-to-right maxima coincide with the descents (entries followed by a smaller number). For example, a(4) counts 2143, 3142, 3241, 4123. - David Callan, Jul 20 2005
From Gus Wiseman, Feb 10 2019: (Start)
Also the number of stable partitions of an n-cycle, where a stable partition of a graph is a set partition of the vertex set such that no edge has both ends in the same block. A bijective proof is given in David Callan's article. For example, the a(5) = 11 stable partitions are:
{{1},{2},{3},{4},{5}}
{{1},{2},{3,5},{4}}
{{1},{2,4},{3},{5}}
{{1},{2,5},{3},{4}}
{{1,3},{2},{4},{5}}
{{1,4},{2},{3},{5}}
{{1},{2,4},{3,5}}
{{1,3},{2,4},{5}}
{{1,3},{2,5},{4}}
{{1,4},{2},{3,5}}
{{1,4},{2,5},{3}}
(End)
Also number of partitions of {1, 2, ..., n-1} with singletons. E.g., a(4) = 4: {1|2|3, 12|3, 13|2, 1|23}. Also number of cyclical adjacencies partitions of {1, 2, ..., n-1}. E.g., a(4) = 4: {12|3, 13|2, 1|23, 123}. The two partitions can be mapped by a Kreweras bijection. - Yuchun Ji, Feb 22 2021
Also the k-th central moment of a Poisson random variable with mean 1. a(n) = E[(X-1)^n, X~Poisson(1)]. - Thomas Dybdahl Ahle, Dec 14 2022

Examples

			a(4) = card({{{1, 2}, {3, 4}}, {{1, 4}, {2, 3}}, {{1, 3}, {2, 4}}, {{1, 2, 3, 4}}}) = 4.
		

References

  • Martin Gardner in Sci. Amer. May 1977.
  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.5 (p. 436).
  • G. Pólya and G. Szegő, Problems and Theorems in Analysis, Springer-Verlag, NY, 2 vols., 1972, Vol. 1, p. 228.
  • J. Riordan, A budget of rhyme scheme counts, pp. 455-465 of Second International Conference on Combinatorial Mathematics, New York, April 4-7, 1978. Edited by Allan Gewirtz and Louis V. Quintas. Annals New York Academy of Sciences, 319, 1979.
  • J. Shallit, A Triangle for the Bell numbers, in V. E. Hoggatt, Jr. and M. Bicknell-Johnson, A Collection of Manuscripts Related to the Fibonacci Sequence, 1980, pp. 69-71.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A diagonal of triangle in A106436.
Row sums of the triangle of associated Stirling numbers of second kind A008299. - Philippe Deléham, Feb 10 2005
Row sums of the triangle of basic multinomial coefficients A178866. - Johannes W. Meijer, Jun 21 2010
Row sums of A105794. - Peter Bala, Jan 14 2015
Row sums of A261139, main diagonal of A261137.
Column k=0 of A216963.
Column k=0 of A124323.

Programs

  • Magma
    [1,0] cat [ n le 1 select 1 else Bell(n)-Self(n-1) : n in [1..40]]; // Vincenzo Librandi, Jun 22 2015
    
  • Maple
    spec := [ B, {B=Set(Set(Z,card>1))}, labeled ]; [seq(combstruct[count](spec, size=n), n=0..30)];
    with(combinat): A000296 :=n->(-1)^n + add((-1)^(j-1)*bell(n-j),j=1..n): seq(A000295(n),n=0..30); # Emeric Deutsch, Oct 29 2006
    f:=exp(exp(x)-1-x): fser:=series(f, x=0, 31): 1, seq(n!*coeff(fser, x^n), n=1..23); # Zerinvary Lajos, Nov 22 2006
    G:={P=Set(Set(Atom,card>=2))}: combstruct[gfsolve](G,unlabeled,x): seq(combstruct[count]([P,G,labeled], size=i), i=0..23); # Zerinvary Lajos, Dec 16 2007
    # [a(0),a(1),..,a(n)]
    A000296_list := proc(n)
    local A, R, i, k;
    if n = 0 then return 1 fi;
    A := array(0..n-1);
    A[0] := 1; R := 1;
    for i from 0 to n-2 do
       A[i+1] := A[0] - A[i];
       A[i] := A[0];
       for k from i by -1 to 1 do
          A[k-1] := A[k-1] + A[k] od;
       R := R,A[i+1];
    od;
    R,A[0]-A[i] end:
    A000296_list(100);  # Peter Luschny, Apr 09 2011
  • Mathematica
    nn = 25; Range[0, nn]! CoefficientList[Series[Exp[Exp[x] - 1 - x], {x, 0, nn}], x]
    (* Second program: *)
    a[n_] := a[n] = If[n==0, 1, Sum[Binomial[n-1, i]*a[n-i-1], {i, 1, n-1}]]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Feb 06 2016, after Vladimir Kruchinin *)
    spsu[,{}]:={{}};spsu[foo,set:{i_,_}]:= Join@@Function[s,Prepend[#,s]&/@spsu[ Select[foo,Complement[#, Complement[set,s]]=={}&], Complement[set,s]]]/@Cases[foo,{i,_}];
    Table[Length[spsu[Select[Subsets[Range[n]],Select[Partition[Range[n],2,1,1], Function[ed,Complement[ed,#]=={}]]=={}&],Range[n]]],{n,8}] (* Gus Wiseman, Feb 10 2019 *)
    s = 1; Join[{1}, Table[s = BellB[n] - s, {n, 0, 25}]] (* Vaclav Kotesovec, Jun 20 2022 *)
  • Maxima
    a(n):=if n=0 then 1 else sum(binomial(n-1,i)*a(n-i-1),i,1,n-1); /* Vladimir Kruchinin, Feb 22 2015 */
    
  • PARI
    a(n) = if(n<2, n==0, subst( polinterpolate( Vec( serlaplace( exp( exp( x+O(x^n)/x )-1 ) ) ) ), x, n) )
    
  • Python
    from itertools import accumulate, islice
    def A000296_gen():
        yield from (1,0)
        blist, a, b = (1,), 0, 1
        while True:
            blist = list(accumulate(blist, initial = (b:=blist[-1])))
            yield (a := b-a)
    A000296_list = list(islice(A000296_gen(),20)) # Chai Wah Wu, Jun 22 2022

Formula

E.g.f.: exp(exp(x) - 1 - x).
B(n) = a(n) + a(n+1), where B = A000110 = Bell numbers [Becker].
Inverse binomial transform of Bell numbers (A000110).
a(n)= Sum_{k>=-1} (k^n/(k+1)!)/exp(1). - Vladeta Jovovic and Karol A. Penson, Feb 02 2003
a(n) = Sum_{k=0..n} ((-1)^(n-k))*binomial(n, k)*Bell(k) = (-1)^n + Bell(n) - A087650(n), with Bell(n) = A000110(n). - Wolfdieter Lang, Dec 01 2003
O.g.f.: A(x) = 1/(1-0*x-1*x^2/(1-1*x-2*x^2/(1-2*x-3*x^2/(1-... -(n-1)*x-n*x^2/(1- ...))))) (continued fraction). - Paul D. Hanna, Jan 17 2006
a(n) = Sum_{k = 0..n} {(-1)^(n-k) * Sum_{j = 0..k}((-1)^j * binomial(k,j) * (1-j)^n)/ k!} = sum over row n of A105794. - Tom Copeland, Jun 05 2006
a(n) = (-1)^n + Sum_{j=1..n} (-1)^(j-1)*B(n-j), where B(q) are the Bell numbers (A000110). - Emeric Deutsch, Oct 29 2006
Let A be the upper Hessenberg matrix of order n defined by: A[i, i-1] = -1, A[i,j] = binomial(j-1, i-1), (i <= j), and A[i, j] = 0 otherwise. Then, for n >= 2, a(n) = (-1)^(n)charpoly(A,1). - Milan Janjic, Jul 08 2010
From Sergei N. Gladkovskii, Sep 20 2012, Oct 11 2012, Dec 19 2012, Jan 15 2013, May 13 2013, Jul 20 2013, Oct 19 2013, Jan 25 2014: (Start)
Continued fractions:
G.f.: (2/E(0) - 1)/x where E(k) = 1 + 1/(1 + 2*x/(1 - 2*(k+1)*x/E(k+1))).
G.f.: 1/U(0) where U(k) = 1 - x*k - x^2*(k+1)/U(k+1).
G.f.: G(0)/(1+2*x) where G(k) = 1 - 2*x*(k+1)/((2*k+1)*(2*x*k-x-1) - x*(2*k+1)*(2*k+3)*(2*x*k-x-1)/(x*(2*k+3) - 2*(k+1)*(2*x*k-1)/G(k+1))).
G.f.: (G(0) - 1)/(x-1) where G(k) = 1 - 1/(1+x-k*x)/(1-x/(x-1/G(k+1))).
G.f.: 1 + x^2/(1+x)/Q(0) where Q(k) = 1-x-x/(1-x*(2*k+1)/(1-x-x/(1-x*(2*k+2)/Q(k+1)))).
G.f.: 1/(x*Q(0)) where Q(k) = 1 + 1/(x + x^2/(1 - x - (k+1)/Q(k+1))).
G.f.: -(1+(2*x+1)/G(0))/x where G(k) = x*k - x - 1 - (k+1)*x^2/G(k+1).
G.f.: T(0) where T(k) = 1 - x^2*(k+1)/( x^2*(k+1) - (1-x*k)*(1-x-x*k)/T(k+1)).
G.f.: (1 + x * Sum_{k>=0} (x^k / Product_{p=0..k}(1 - p*x))) / (1 + x). (End)
a(n) = Sum_{i=1..n-1} binomial(n-1,i)*a(n-i-1), a(0)=1. - Vladimir Kruchinin, Feb 22 2015
G.f. A(x) satisfies: A(x) = (1/(1 + x)) * (1 + x * A(x/(1 - x)) / (1 - x)). - Ilya Gutkovskiy, May 21 2021
a(n) ~ exp(n/LambertW(n) - n - 1) * n^(n-1) / (sqrt(1 + LambertW(n)) * LambertW(n)^(n-1)). - Vaclav Kotesovec, Jun 28 2022

Extensions

More terms, new description from Christian G. Bower, Nov 15 1999
a(23) corrected by Sean A. Irvine, Jun 22 2015

A005493 2-Bell numbers: a(n) = number of partitions of [n+1] with a distinguished block.

Original entry on oeis.org

1, 3, 10, 37, 151, 674, 3263, 17007, 94828, 562595, 3535027, 23430840, 163254885, 1192059223, 9097183602, 72384727657, 599211936355, 5150665398898, 45891416030315, 423145657921379, 4031845922290572, 39645290116637023, 401806863439720943, 4192631462935194064
Offset: 0

Views

Author

Keywords

Comments

Number of Boolean sublattices of the Boolean lattice of subsets of {1..n}.
a(n) = p(n+1) where p(x) is the unique degree n polynomial such that p(k) = A000110(k+1) for k = 0, 1, ..., n. - Michael Somos, Oct 07 2003
With offset 1, number of permutations beginning with 12 and avoiding 21-3.
Rows sums of Bell's triangle (A011971). - Jorge Coveiro, Dec 26 2004
Number of blocks in all set partitions of an (n+1)-set. Example: a(2)=10 because the set partitions of {1,2,3} are 1|2|3, 1|23, 12|3, 13|2 and 123, with a total of 10 blocks. - Emeric Deutsch, Nov 13 2006
Number of partitions of n+3 with at least one singleton and with the smallest element in a singleton equal to 2. - Olivier Gérard, Oct 29 2007
See page 29, Theorem 5.6 of my paper on the arXiv: These numbers are the dimensions of the homogeneous components of the operad called ComTrip associated with commutative triplicial algebras. (Triplicial algebras are related to even trees and also to L-algebras, see A006013.) - Philippe Leroux, Nov 17 2007
Number of set partitions of (n+2) elements where two specific elements are clustered separately. Example: a(1)=3 because 1/2/3, 1/23, 13/2 are the 3 set partitions with 1, 2 clustered separately. - Andrey Goder (andy.goder(AT)gmail.com), Dec 17 2007
Equals A008277 * [1,2,3,...], i.e., the product of the Stirling number of the second kind triangle and the natural number vector. a(n+1) = row sums of triangle A137650. - Gary W. Adamson, Jan 31 2008
Prefaced with a "1" = row sums of triangle A152433. - Gary W. Adamson, Dec 04 2008
Equals row sums of triangle A159573. - Gary W. Adamson, Apr 16 2009
Number of embedded coalitions in an (n+1)-person game. - David Yeung (wkyeung(AT)hkbu.edu.hk), May 08 2008
If prefixed with 0, gives first differences of Bell numbers A000110 (cf. A106436). - N. J. A. Sloane, Aug 29 2013
Sum_{n>=0} a(n)/n! = e^(e+1) = 41.19355567... (see A235214). Contrast with e^(e-1) = Sum_{n>=0} A000110(n)/n!. - Richard R. Forberg, Jan 05 2014

Examples

			For example, a(1) counts (12), (1)-2, 1-(2) where dashes separate blocks and the distinguished block is parenthesized.
		

References

  • Olivier Gérard and Karol A. Penson, A budget of set partition statistics, in preparation. Unpublished as of 2017.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A row or column of the array A108087.
Row sums of triangle A143494. - Wolfdieter Lang, Sep 29 2011. And also of triangle A362924. - N. J. A. Sloane, Aug 10 2023

Programs

  • Maple
    with(combinat): seq(bell(n+2)-bell(n+1),n=0..22); # Emeric Deutsch, Nov 13 2006
    seq(add(binomial(n, k)*(bell(n-k)), k=1..n), n=1..23); # Zerinvary Lajos, Dec 01 2006
    A005493  := proc(n) local a,b,i;
    a := [seq(3,i=1..n)]; b := [seq(2,i=1..n)];
    2^n*exp(-x)*hypergeom(a,b,x); round(evalf(subs(x=1,%),66)) end:
    seq(A005493(n),n=0..22); # Peter Luschny, Mar 30 2011
    BT := proc(n,k) option remember; if n = 0 and k = 0 then 1
    elif k = n then BT(n-1,0) else BT(n,k+1)+BT(n-1,k) fi end:
    A005493 := n -> add(BT(n,k),k=0..n):
    seq(A005493(i),i=0..22); # Peter Luschny, Aug 04 2011
    # For Maple code for r-Bell numbers, etc., see A232472. - N. J. A. Sloane, Nov 27 2013
  • Mathematica
    a=Exp[x]-1; Rest[CoefficientList[Series[a Exp[a],{x,0,20}],x] * Table[n!,{n,0,20}]]
    a[ n_] := If[ n<0, 0, With[ {m = n+1}, m! SeriesCoefficient[ # Exp@# &[ Exp@x - 1], {x, 0, m}]]]; (* Michael Somos, Nov 16 2011 *)
    Differences[BellB[Range[30]]] (* Harvey P. Dale, Oct 16 2014 *)
  • PARI
    {a(n) = if( n<0, 0, n! * polcoeff( exp( exp( x + x * O(x^n)) + 2*x - 1), n))}; /* Michael Somos, Oct 09 2002 */
    
  • PARI
    {a(n) = if( n<0, 0, n+=2; subst( polinterpolate( Vec( serlaplace( exp( exp( x + O(x^n)) - 1) - 1))), x, n))}; /* Michael Somos, Oct 07 2003 */
    
  • Python
    # requires python 3.2 or higher. Otherwise use def'n of accumulate in python docs.
    from itertools import accumulate
    A005493_list, blist, b = [], [1], 1
    for _ in range(1001):
        blist = list(accumulate([b]+blist))
        b = blist[-1]
        A005493_list.append(blist[-2])
    # Chai Wah Wu, Sep 02 2014, updated Chai Wah Wu, Sep 20 2014

Formula

a(n-1) = Sum_{k=1..n} k*Stirling2(n, k) for n>=1.
E.g.f.: exp(exp(x) + 2*x - 1). First differences of Bell numbers (if offset 1). - Michael Somos, Oct 09 2002
G.f.: Sum_{k>=0} (x^k/Product_{l=1..k} (1-(l+1)x)). - Ralf Stephan, Apr 18 2004
a(n) = Sum_{i=0..n} 2^(n-i)*B(i)*binomial(n,i) where B(n) = Bell numbers A000110(n). - Fred Lunnon, Aug 04 2007 [Written umbrally, a(n) = (B+2)^n. - N. J. A. Sloane, Feb 07 2009]
Representation as an infinite series: a(n-1) = Sum_{k>=2} (k^n*(k-1)/k!)/exp(1), n=1, 2, ... This is a Dobinski-type summation formula. - Karol A. Penson, Mar 14 2002
Row sums of A011971 (Aitken's array, also called Bell triangle). - Philippe Deléham, Nov 15 2003
a(n) = exp(-1)*Sum_{k>=0} ((k+2)^n)/k!. - Gerald McGarvey, Jun 03 2004
Recurrence: a(n+1) = 1 + Sum_{j=1..n} (1+binomial(n, j))*a(j). - Jon Perry, Apr 25 2005
a(n) = A000296(n+3) - A000296(n+1). - Philippe Deléham, Jul 31 2005
a(n) = B(n+2) - B(n+1), where B(n) are Bell numbers (A000110). - Franklin T. Adams-Watters, Jul 13 2006
a(n) = A123158(n,2). - Philippe Deléham, Oct 06 2006
Binomial transform of Bell numbers 1, 2, 5, 15, 52, 203, 877, 4140, ... (see A000110).
Define f_1(x), f_2(x), ... such that f_1(x)=x*e^x, f_{n+1}(x) = (d/dx)(x*f_n(x)), for n=2,3,.... Then a(n-1) = e^(-1)*f_n(1). - Milan Janjic, May 30 2008
Representation of numbers a(n), n=0,1..., as special values of hypergeometric function of type (n)F(n), in Maple notation: a(n)=exp(-1)*2^n*hypergeom([3,3...3],[2.2...2],1), n=0,1..., i.e., having n parameters all equal to 3 in the numerator, having n parameters all equal to 2 in the denominator and the value of the argument equal to 1. Examples: a(0)= 2^0*evalf(hypergeom([],[],1)/exp(1))=1 a(1)= 2^1*evalf(hypergeom([3],[2],1)/exp(1))=3 a(2)= 2^2*evalf(hypergeom([3,3],[2,2],1)/exp(1))=10 a(3)= 2^3*evalf(hypergeom([3,3,3],[2,2,2],1)/exp(1))=37 a(4)= 2^4*evalf(hypergeom([3,3,3,3],[2,2,2,2],1)/exp(1))=151 a(5)= 2^5*evalf(hypergeom([3,3,3,3,3],[2,2,2,2,2],1)/exp(1)) = 674. - Karol A. Penson, Sep 28 2007
Let A be the upper Hessenberg matrix of order n defined by: A[i,i-1]=-1, A[i,j]=binomial(j-1,i-1), (i <= j), and A[i,j]=0 otherwise. Then, for n >= 1, a(n) = (-1)^(n)charpoly(A,-2). - Milan Janjic, Jul 08 2010
a(n) = D^(n+1)(x*exp(x)) evaluated at x = 0, where D is the operator (1+x)*d/dx. Cf. A003128, A052852 and A009737. - Peter Bala, Nov 25 2011
From Sergei N. Gladkovskii, Oct 11 2012 to Jan 26 2014: (Start)
Continued fractions:
G.f.: 1/U(0) where U(k) = 1 - x*(k+3) - x^2*(k+1)/U(k+1).
G.f.: 1/(U(0)-x) where U(k) = 1 - x - x*(k+1)/(1 - x/U(k+1)).
G.f.: G(0)/(1-x) where G(k) = 1 - 2*x*(k+1)/((2*k+1)*(2*x*k+2*x-1) - x*(2*k+1)*(2*k+3)*(2*x*k+2*x-1)/(x*(2*k+3) - 2*(k+1)*(2*x*k+3*x-1)/G(k+1) )).
G.f.: (G(0) - 1)/(x-1) where G(k) = 1 - 1/(1-2*x-k*x)/(1-x/(x-1/G(k+1) )).
G.f.: -G(0)/x where G(k) = 1 - 1/(1-k*x-x)/(1-x/(x-1/G(k+1) )).
G.f.: 1 - 2/x + (1/x-1)*S where S = sum(k>=0, ( 1 + (1-x)/(1-x-x*k) )*(x/(1-x))^k / prod(i=0..k-1, (1-x-x*i)/(1-x) ) ).
G.f.: (1-x)/x/(G(0)-x) - 1/x where G(k) = 1 - x*(k+1)/(1 - x/G(k+1) ).
G.f.: (1/G(0) - 1)/x^3 where G(k) = 1 - x/(x - 1/(1 + 1/(x*k-1)/G(k+1) )).
G.f.: 1/Q(0), where Q(k)= 1 - 2*x - x/(1 - x*(k+1)/Q(k+1)).
G.f.: G(0)/(1-3*x), where G(k) = 1 - x^2*(k+1)/( x^2*(k+1) - (1 - x*(k+3))*(1 - x*(k+4))/G(k+1) ). (End)
a(n) ~ exp(n/LambertW(n) + 3*LambertW(n)/2 - n - 1) * n^(n + 1/2) / LambertW(n)^(n+1). - Vaclav Kotesovec, Jun 09 2020
a(0) = 1; a(n) = 2 * a(n-1) + Sum_{k=0..n-1} binomial(n-1,k) * a(k). - Ilya Gutkovskiy, Jul 02 2020
a(n) ~ n^2 * Bell(n) / LambertW(n)^2 * (1 - LambertW(n)/n). - Vaclav Kotesovec, Jul 28 2021
a(n) = Sum_{k=0..n} 3^k*A124323(n, k). - Mélika Tebni, Jun 02 2022

Extensions

Definition revised by David Callan, Oct 11 2005

A052841 Expansion of e.g.f.: 1/(exp(x)*(2-exp(x))).

Original entry on oeis.org

1, 0, 2, 6, 38, 270, 2342, 23646, 272918, 3543630, 51123782, 811316286, 14045783798, 263429174190, 5320671485222, 115141595488926, 2657827340990678, 65185383514567950, 1692767331628422662, 46400793659664205566, 1338843898122192101558, 40562412499252036940910
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

From Michael Somos, Mar 04 2004: (Start)
Stirling transform of A005359(n)=[0,2,0,24,0,720,...] is a(n)=[0,2,6,38,270,...].
Stirling transform of -(-1)^n*A052657(n-1)=[0,0,2,-6,48,-240,...] is a(n-1)=[0,0,2,6,38,270,...].
Stirling transform of -(-1)^n*A052558(n-1)=[1,-1,4,-12,72,-360,...] is a(n-1)=[1,0,2,6,38,270,...].
Stirling transform of 2*A052591(n)=[2,4,24,96,...] is a(n+1)=[2,6,38,270,...].
(End)
Also the central moments of a Geometric(1/2) random variable (for example the number of coin tosses until the first head). - Svante Janson, Dec 10 2012
Also the number of ordered set partitions of {1..n} with no cyclical adjacencies (successive elements in the same block, where 1 is a successor of n). - Gus Wiseman, Feb 13 2019
Also the number of ordered set partitions of {1..n} with an even number of blocks. - Geoffrey Critzer, Jul 04 2020

Examples

			From _Gus Wiseman_, Feb 13 2019: (Start)
The a(4) = 38 ordered set partitions with no cyclical adjacencies:
  {{1}{2}{3}{4}}  {{1}{24}{3}}  {{13}{24}}
  {{1}{2}{4}{3}}  {{1}{3}{24}}  {{24}{13}}
  {{1}{3}{2}{4}}  {{13}{2}{4}}
  {{1}{3}{4}{2}}  {{13}{4}{2}}
  {{1}{4}{2}{3}}  {{2}{13}{4}}
  {{1}{4}{3}{2}}  {{2}{4}{13}}
  {{2}{1}{3}{4}}  {{24}{1}{3}}
  {{2}{1}{4}{3}}  {{24}{3}{1}}
  {{2}{3}{1}{4}}  {{3}{1}{24}}
  {{2}{3}{4}{1}}  {{3}{24}{1}}
  {{2}{4}{1}{3}}  {{4}{13}{2}}
  {{2}{4}{3}{1}}  {{4}{2}{13}}
  {{3}{1}{2}{4}}
  {{3}{1}{4}{2}}
  {{3}{2}{1}{4}}
  {{3}{2}{4}{1}}
  {{3}{4}{1}{2}}
  {{3}{4}{2}{1}}
  {{4}{1}{2}{3}}
  {{4}{1}{3}{2}}
  {{4}{2}{1}{3}}
  {{4}{2}{3}{1}}
  {{4}{3}{1}{2}}
  {{4}{3}{2}{1}}
(End)
		

Crossrefs

Main diagonal of A122101.
Inverse binomial transform of A000670.

Programs

  • Magma
    R:=PowerSeriesRing(Rationals(), 40);
    Coefficients(R!(Laplace( Exp(-x)/(2-Exp(x)) ))); // G. C. Greubel, Jun 11 2024
    
  • Maple
    spec := [S,{B=Prod(C,C),C=Set(Z,1 <= card),S=Sequence(B)},labeled]: seq(combstruct[count](spec,size=n), n=0..20);
    P := proc(n,x) option remember; if n = 0 then 1 else
    (n*x+2*(1-x))*P(n-1,x)+x*(1-x)*diff(P(n-1,x),x); expand(%) fi end:
    A052841 := n -> subs(x=2, P(n,x)):
    seq(A052841(n), n=0..21); # Peter Luschny, Mar 07 2014
    h := n -> add(combinat:-eulerian1(n, k)*2^k, k=0..n):
    a := n -> (h(n)+(-1)^n)/2: seq(a(n), n=0..21); # Peter Luschny, Sep 19 2015
    b := proc(n, m) option remember; if n = 0 then 1 else
         (m - 1)*b(n - 1, m) + (m + 1)*b(n - 1, m + 1) fi end:
    a := n -> b(n, 0): seq(a(n), n = 0..21); # Peter Luschny, Jun 23 2023
  • Mathematica
    a[n_] := If[n == 0, 1, (PolyLog[-n, 1/2]/2 + (-1)^n)/2]; (* or *)
    a[n_] := HurwitzLerchPhi[1/2, -n, -1]/2; Table[a[n], {n, 0, 21}] (* Jean-François Alcover, Feb 19 2016, after Vladeta Jovovic *)
    With[{nn=30},CoefficientList[Series[1/(Exp[x](2-Exp[x])),{x,0,nn}],x] Range[ 0,nn]!] (* Harvey P. Dale, Apr 08 2019 *)
  • PARI
    a(n)=if(n<0,0,n!*polcoeff(subst(1/(1-y^2),y,exp(x+x*O(x^n))-1),n))
    
  • PARI
    {a(n)=polcoeff(sum(m=0,n,(2*m)!*x^(2*m)/prod(k=1,2*m,1-k*x+x*O(x^n))),n)} /* Paul D. Hanna, Jul 20 2011 */
    
  • SageMath
    def A052841_list(prec):
        P. = PowerSeriesRing(QQ, prec)
        return P( exp(-x)/(2-exp(x)) ).egf_to_ogf().list()
    A052841_list(40) # G. C. Greubel, Jun 11 2024

Formula

O.g.f.: Sum_{n>=0} (2*n)! * x^(2*n) / Product_{k=1..2*n} (1-k*x). - Paul D. Hanna, Jul 20 2011
a(n) = (A000670(n) + (-1)^n)/2 = Sum_{k>=0} (k-1)^n/2^(k+1). - Vladeta Jovovic, Feb 02 2003
Also, a(n) = Sum_{k=0..[n/2]} (2k)!*Stirling2(n, 2k). - Ralf Stephan, May 23 2004
a(n) = D^n*(1/(1-x^2)) evaluated at x = 0, where D is the operator (1+x)*d/dx. Cf. A000670 and A005649. - Peter Bala, Nov 25 2011
E.g.f.: 1/(2*G(0)), where G(k) = 1 - 2^k/(2 - 4*x/(2*x - 2^k*(k+1)/G(k+1) )); (recursively defined continued fraction). - Sergei N. Gladkovskii, Dec 22 2012
a(n) ~ n!/(4*(log(2))^(n+1)). - Vaclav Kotesovec, Aug 10 2013
a(n) = (h(n)+(-1)^n)/2 where h(n) = Sum_{k=0..n} E(n,k)*2^k and E(n,k) the Eulerian numbers A173018 (see also A156365). - Peter Luschny, Sep 19 2015
a(n) = (-1)^n + Sum_{k=0..n-1} binomial(n,k) * a(k). - Ilya Gutkovskiy, Jun 11 2020

Extensions

Edited by N. J. A. Sloane, Sep 06 2013

A056857 Triangle read by rows: T(n,c) = number of successive equalities in set partitions of n.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 5, 6, 3, 1, 15, 20, 12, 4, 1, 52, 75, 50, 20, 5, 1, 203, 312, 225, 100, 30, 6, 1, 877, 1421, 1092, 525, 175, 42, 7, 1, 4140, 7016, 5684, 2912, 1050, 280, 56, 8, 1, 21147, 37260, 31572, 17052, 6552, 1890, 420, 72, 9, 1, 115975, 211470, 186300, 105240, 42630, 13104, 3150, 600, 90, 10, 1
Offset: 1

Views

Author

Winston C. Yang (winston(AT)cs.wisc.edu), Aug 31 2000

Keywords

Comments

Number of successive equalities s_i = s_{i+1} in a set partition {s_1, ..., s_n} of {1, ..., n}, where s_i is the subset containing i, s(1) = 1 and s(i) <= 1 + max of previous s(j)'s.
T(n,c) = number of set partitions of the set {1,2,...,n} in which the size of the block containing the element 1 is k+1. Example: T(4,2)=3 because we have 123|4, 124|3 and 134|2. - Emeric Deutsch, Nov 10 2006
Let P be the lower-triangular Pascal-matrix (A007318), Then this is exp(P) / exp(1). - Gottfried Helms, Mar 30 2007. [This comment was erroneously attached to A011971, but really belongs here. - N. J. A. Sloane, May 02 2015]
From David Pasino (davepasino(AT)yahoo.com), Apr 15 2009: (Start)
As an infinite lower-triangular matrix (with offset 0 rather than 1, so the entries would be B(n - c)*binomial(n, c), B() a Bell number, rather than B(n - 1 - c)*binomial(n - 1, c) as below), this array is S P S^-1 where P is the Pascal matrix A007318, S is the Stirling2 matrix A048993, and S^-1 is the Stirling1 matrix A048994.
Also, S P S^-1 = (1/e)*exp(P). (End)
Exponential Riordan array [exp(exp(x)-1), x]. Equal to A007318*A124323. - Paul Barry, Apr 23 2009
Equal to A049020*A048994 as infinite lower triangular matrices. - Philippe Deléham, Nov 19 2011
Build a superset Q[n] of set partitions of {1,2,...,n} by distinguishing "some" (possibly none or all) of the singletons. Indexed from n >= 0, 0 <= k <= n, T(n,k) is the number of elements in Q[n] that have exactly k distinguished singletons. A singleton is a subset containing one element. T(3,1) = 6 because we have {{1}'{2,3}}, {{1,2}{3}'}, {{1,3}{2}'}, {{1}'{2}{3}}, {{1}{2}'{3}}, {{1}{2}{3}'}. - Geoffrey Critzer, Nov 10 2012
Let Bell(n,x) denote the n-th Bell polynomial, the n-th row polynomial of A048993. Then this is the triangle of connection constants when expressing the basis polynomials Bell(n,x + 1) in terms of the basis polynomials Bell(n,x). For example, row 3 is (5, 6, 3, 1) and 5 + 6*Bell(1,x) + 3*Bell(2,x) + Bell(3,x) = 5 + 6*x + 3*(x + x^2) + (x + 3*x^2 + x^3) = 5 + 10*x + 6*x^2 + x^3 = (x + 1) + 3*(x + 1)^2 + (x + 1)^3 = Bell(3,x + 1). - Peter Bala, Sep 17 2013

Examples

			For example {1, 2, 1, 2, 2, 3} is a set partition of {1, 2, 3, 4, 5, 6} and has 1 successive equality, at i = 4.
Triangle begins:
    1;
    1,   1;
    2,   2,   1;
    5,   6,   3,   1;
   15,  20,  12,   4,   1;
   52,  75,  50,  20,   5,   1;
  203, 312, 225, 100,  30,   6,   1;
  ...
From _Paul Barry_, Apr 23 2009: (Start)
Production matrix is
  1,  1;
  1,  1,  1;
  1,  2,  1,  1;
  1,  3,  3,  1,  1;
  1,  4,  6,  4,  1,  1;
  1,  5, 10, 10,  5,  1,  1;
  1,  6, 15, 20, 15,  6,  1,  1;
  1,  7, 21, 35, 35, 21,  7,  1,  1;
  1,  8, 28, 56, 70, 56, 28,  8,  1,  1; ... (End)
		

References

  • W. C. Yang, Conjectures on some sequences involving set partitions and Bell numbers, preprint, 2000. [Apparently unpublished]

Crossrefs

Cf. Bell numbers A000110 (column c=0), A052889 (c=1), A105479 (c=2), A105480 (c=3).
Cf. A056858-A056863. Essentially same as A056860, where the rows are read from right to left.
Cf. also A007318, A005493, A270953.
See A259691 for another version.
T(2n+1,n+1) gives A124102.
T(2n,n) gives A297926.

Programs

  • Maple
    with(combinat): A056857:=(n,c)->binomial(n-1,c)*bell(n-1-c): for n from 1 to 11 do seq(A056857(n,c),c=0..n-1) od; # yields sequence in triangular form; Emeric Deutsch, Nov 10 2006
    with(linalg): # Yields sequence in matrix form:
    A056857_matrix := n -> subs(exp(1)=1, exponential(exponential(
    matrix(n,n,[seq(seq(`if`(j=k+1,j,0),k=0..n-1),j=0..n-1)])))):
    A056857_matrix(8); # Peter Luschny, Apr 18 2011
  • Mathematica
    t[n_, k_] := BellB[n-1-k]*Binomial[n-1, k]; Flatten[ Table[t[n, k], {n, 1, 11}, {k, 0, n-1}]](* Jean-François Alcover, Apr 25 2012, after Emeric Deutsch *)
  • PARI
    B(n) = sum(k=0, n, stirling(n, k, 2));
    tabl(nn)={for(n=1, nn, for(k=0, n - 1, print1(B(n - 1 - k) * binomial(n - 1, k),", ");); print(););};
    tabl(12); \\ Indranil Ghosh, Mar 19 2017
    
  • Python
    from sympy import bell, binomial
    for n in range(1,12):
        print([bell(n - 1 - k) * binomial(n - 1, k) for k in range(n)]) # Indranil Ghosh, Mar 19 2017
    
  • SageMath
    def a(n): return (-1)^n / factorial(n)
    @cached_function
    def p(n, m):
        R = PolynomialRing(QQ, "x")
        if n == 0: return R(a(m))
        return R((m + x)*p(n - 1, m) - (m + 1)*p(n - 1, m + 1))
    for n in range(11): print(p(n, 0).list())  # Peter Luschny, Jun 18 2023

Formula

T(n,c) = B(n-1-c)*binomial(n-1, c), where T(n,c) is the number of set partitions of {1, ..., n} that have c successive equalities and B() is a Bell number.
E.g.f.: exp(exp(x)+x*y-1). - Vladeta Jovovic, Feb 13 2003
G.f.: 1/(1-xy-x-x^2/(1-xy-2x-2x^2/(1-xy-3x-3x^2/(1-xy-4x-4x^2/(1-... (continued fraction). - Paul Barry, Apr 23 2009
Considered as triangle T(n,k), 0 <= k <= n: T(n,k) = A007318(n,k)*A000110(n-k) and Sum_{k=0..n} T(n,k)*x^k = A000296(n), A000110(n), A000110(n+1), A005493(n), A005494(n), A045379(n) for x = -1, 0, 1, 2, 3, 4 respectively. - Philippe Deléham, Dec 13 2009
Let R(n,x) denote the n-th row polynomial of the triangle. Then A000110(n+j) = Bell(n+j,1) = Sum_{k = 1..n} R(j,k)*Stirling2(n,k) (Spivey). - Peter Bala, Sep 17 2013

Extensions

More terms from David Wasserman, Apr 22 2002

A005494 3-Bell numbers: E.g.f.: exp(3*z + exp(z) - 1).

Original entry on oeis.org

1, 4, 17, 77, 372, 1915, 10481, 60814, 372939, 2409837, 16360786, 116393205, 865549453, 6713065156, 54190360453, 454442481041, 3952241526188, 35590085232519, 331362825860749, 3185554606447814, 31581598272055879, 322516283206446897, 3389017736055752178
Offset: 0

Views

Author

Keywords

Comments

For further information, references, programs, etc. for r-Bell numbers see A005493. - N. J. A. Sloane, Nov 27 2013
From expansion of falling factorials (binomial transform of A005493).
Row sums of Sheffer triangle (exp(3*x), exp(x)-1). - Wolfdieter Lang, Sep 29 2011

Examples

			G.f. = 1 + 4*x + 17*x^2 + 77*x^3 + 372*x^4 + 1915*x^5 + 10481*x^6 + 60814*x^7 + ...
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A row or column of the array A108087.

Programs

  • Magma
    A005494:= func< n | (&+[Binomial(n,j)*3^(n-j)*Bell(j): j in [0..n]]) >;
    [A005494(n): n in [0..30]]; // G. C. Greubel, Dec 01 2022
    
  • Maple
    seq(add(3^(n-i)*combinat:-bell(i)*binomial(n,i),i=0..n), n=0..50); # Robert Israel, Dec 16 2014
    # second Maple program:
    b:= proc(n, m) option remember; `if`(n=0,
          m^2, m*b(n-1, m)+b(n-1, m+1))
        end:
    a:= n-> b(n+1, 0)-b(n, 0):
    seq(a(n), n=0..23);  # Alois P. Heinz, Aug 03 2025
  • Mathematica
    Range[0, 40]! CoefficientList[Series[Exp[3 x + Exp[x] - 1], {x, 0, 40}], x] (* Vincenzo Librandi, Mar 04 2014 *)
  • SageMath
    def A005494(n): return sum( 3^(n-j)*bell_number(j)*binomial(n,j) for j in range(n+1))
    [A005494(n) for n in range(31)] # G. C. Greubel, Dec 01 2022

Formula

a(n) = Sum_{i=0..n} 3^(n-i)*B(i)*binomial(n,i) where B(n) = Bell numbers A000110(n). - Fred Lunnon, Aug 04 2007
a(n) = exp(-1)*Sum_{k>=0} ((k+3)^n)/k!. - Gerald McGarvey, Jun 03 2004. May be rewritten as a(n) = Sum_{k>=3} (k^n*(k-1)*(k-2)/k!)/exp(1), which is a Dobinski-type relation for this sequence. - Karol A. Penson, Aug 18 2006
Define f_1(x), f_2(x), ... such that f_1(x) = x^2*e^x, f_{n+1}(x) = (d/dx)(x*f_n(x)), for n=2,3,.... Then a(n-1) = e^(-1)*f_n(1). - Milan Janjic, May 30 2008
Let A be the upper Hessenberg matrix of order n defined by: A[i,i-1]=-1, A[i,j]=binomial(j-1,i-1), (i <= j), and A[i,j]=0 otherwise. Then, for n >= 1, a(n) = (-1)^(n)charpoly(A,-3). - Milan Janjic, Jul 08 2010
a(n) = Sum_{k=3..n+3} A143495(n+3,k), n >= 0. - Wolfdieter Lang, Sep 29 2011
G.f.: 1/U(0) where U(k)= 1 - x*(k+4) - x^2*(k+1)/U(k+1); (continued fraction, 1-step). - Sergei N. Gladkovskii, Oct 11 2012
G.f.: Sum_{k>0} x^(k-1) / ((1 - 3*x) * (1 - 4*x) * ... * (1 - (k+2)*x)). - Michael Somos, Feb 26 2014
G.f.: Sum_{k>0} k * x^(k-1) / ((1 - 2*x) * (1 - 3*x) * ... * (1 - (k+1)*x)). - Michael Somos, Feb 26 2014
a(n) ~ exp(n/LambertW(n) - n - 1) * n^(n + 3) / LambertW(n)^(n + 7/2). - Vaclav Kotesovec, Jun 10 2020
a(0) = 1; a(n) = 3 * a(n-1) + Sum_{k=0..n-1} binomial(n-1,k) * a(k). - Ilya Gutkovskiy, Jul 02 2020
a(n) = Sum_{k=0..n} 4^k*A124323(n, k). - Mélika Tebni, Jun 10 2022

A080107 Number of fixed points of permutation of SetPartitions under {1,2,...,n}->{n,n-1,...,1}. Number of symmetric arrangements of non-attacking rooks on upper half of n X n chessboard.

Original entry on oeis.org

1, 1, 2, 3, 7, 12, 31, 59, 164, 339, 999, 2210, 6841, 16033, 51790, 127643, 428131, 1103372, 3827967, 10269643, 36738144, 102225363, 376118747, 1082190554, 4086419601, 12126858113, 46910207114, 143268057587, 566845074703, 1778283994284, 7186474088735
Offset: 0

Views

Author

Wouter Meeussen, Mar 15 2003

Keywords

Comments

Even-numbered terms a(2k) are A002872: 2,7,31,164,999 ("Sorting numbers"); odd-numbered terms are its binomial transform, A080337. The symmetrical set partitions of {-n,...,-1,0,1,...,n} can be classified by the partition containing 0. Thus we get the sum over k of {n choose k} times the number of symmetrical set partitions of 2n-2k elements. - Don Knuth, Nov 23 2003
Number of partitions of n numbers that are symmetrical and cannot be nested (i.e., include a pattern of the form abab). - Douglas Boffey, May 21 2015
Number of achiral color patterns in a row or loop of length n. Two color patterns are equivalent if the colors are permuted. - Robert A. Russell, Apr 23 2018
Also the number of self-complementary set partitions of {1, ..., n}. The complement of a set partition pi of {1, ..., n} is defined as n + 1 - pi (elementwise) on page 3 of Callan. For example, the complement of {{1,5},{2},{3,6},{4}} is {{1,4},{2,6},{3},{5}}. - Gus Wiseman, Feb 13 2019

Examples

			Of the set partitions of 4, the following 7 are invariant under 1->4, 2->3, 3->2, 4->1: {{1,2,3,4}}, {{1,2},{3,4}}, {{1,4},{2,3}}, {{1,3},{2,4}}, {{1},{2,3},{4}}, {{1,4},{2},{3}}, {{1},{2},{3},{4}}, so a(4)=7.
For a(4)=7, the row patterns are AAAA, AABB, ABAB, ABBA, ABBC, ABCA, and ABCD (same as previous example).  The loop patterns are AAAA, AAAB, AABB, AABC, ABAB, ABAC, and ABCD. - _Robert A. Russell_, Apr 23 2018
From _Gus Wiseman_, Feb 13 2019: (Start)
The a(1) = 1 through a(5) = 12 self-complementary set partitions:
  {{1}}  {{12}}    {{123}}      {{1234}}        {{12345}}
         {{1}{2}}  {{13}{2}}    {{12}{34}}      {{1245}{3}}
                   {{1}{2}{3}}  {{13}{24}}      {{135}{24}}
                                {{14}{23}}      {{15}{234}}
                                {{1}{23}{4}}    {{1}{234}{5}}
                                {{14}{2}{3}}    {{12}{3}{45}}
                                {{1}{2}{3}{4}}  {{135}{2}{4}}
                                                {{14}{25}{3}}
                                                {{15}{24}{3}}
                                                {{1}{24}{3}{5}}
                                                {{15}{2}{3}{4}}
                                                {{1}{2}{3}{4}{5}}
(End)
		

References

  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.5 (p. 765).

Crossrefs

Programs

  • Mathematica
    < Range[n, 1, -1]]; t= 1 + RankSetPartition /@ t; t= ToCycles[t]; t= Cases[t, {_Integer}]; Length[t], {n, 7}]
    (* second program: *)
    QB[n_, q_] := QB[n, q] = Sum[QB[j, q] QBinomial[n-1, j, q], {j, 0, n-1}] // FunctionExpand // Simplify; QB[0, q_]=1; QB[1, q_]=1; Table[cc = CoefficientList[QB[n, q], q]; cc.Table[(-1)^(k+1), {k, 1, Length[cc]}], {n, 0, 30}] (* Jean-François Alcover, Feb 29 2016, after Paul D. Hanna *)
    (* Ach[n, k] is the number of achiral color patterns for a row or loop of n
      colors containing exactly k different colors *)
    Ach[n_, k_] := Ach[n, k] = If[n<2, Boole[n==k && n>=0],
      k Ach[n-2, k] + Ach[n-2, k-1] + Ach[n-2, k-2]]
    Table[Sum[Ach[n, k], {k, 0, n}], {n, 0, 30}] (* Robert A. Russell, Apr 23 2018 *)
    x[n_] := x[n] = If[n < 2, n+1, 2x[n-1] + (n-1)x[n-2]]; (* A005425 *)
    Table[Sum[StirlingS2[Ceiling[n/2], k] x[k-Mod[n, 2]], {k, 0, Ceiling[n/2]}],
      {n, 0, 30}] (* Robert A. Russell, Apr 27 2018, after Knuth reference *)

Formula

Knuth gives recurrences and generating functions.
a(n) = Sum_{k=0..t(n)} (-1)^k*A125810(n,k) where A125810 is a triangle of coefficients for a q-analog of the Bell numbers and t(n)=A125811(n)-1. - Paul D. Hanna, Jan 19 2009
From Robert A. Russell, Apr 23 2018: (Start)
a(n) = Sum_{k=0..n} Ach(n,k) where
Ach(n,k) = [n>1]*(k*Ach(n-2,k)+Ach(n-2,k-1)+Ach(n-2,k-2)) + [n<2]*[n==k]*[n>=0].
a(n) = 2*A103293(n+1) - A000110(n). (End)
a(n) = [n==0 mod 2]*Sum_{k=0..n/2} Stirling2(n/2, k)*A005425(k) + [n==1 mod 2] * Sum_{k=1..(n+1)/2} Stirling2((n+1)/2, k) * A005425(k-1). (from Knuth reference)
a(n) = 2*A084708(n) - A084423(n). - Robert A. Russell, Apr 27 2018

Extensions

Offset set to 0 by Alois P. Heinz, May 23 2015
Showing 1-10 of 19 results. Next