Bell Number

DOWNLOAD Mathematica Notebook

The number of ways a set of n elements can be partitioned into nonempty subsets is called a Bell number and is denoted B_n (not to be confused with the Bernoulli number, which is also commonly denoted B_n).

For example, there are five ways the numbers {1,2,3} can be partitioned: {{1},{2},{3}}, {{1,2},{3}}, {{1,3},{2}}, {{1},{2,3}}, and {{1,2,3}}, so B_3=5.

B_0=1, and the first few Bell numbers for n=1, 2, ... are 1, 2, 5, 15, 52, 203, 877, 4140, 21147, 115975, ... (OEIS A000110). The numbers of digits in B_(10^n) for n=0, 1, ... are given by 1, 6, 116, 1928, 27665, ... (OEIS A113015).

Bell numbers are implemented in the Wolfram Language as BellB[n].

Though Bell numbers have traditionally been attributed to E. T. Bell as a result of the general theory he developed in his 1934 paper (Bell 1934), the first systematic study of Bell numbers was made by Ramanujan in chapter 3 of his second notebook approximately 25-30 years prior to Bell's work (B. C. Berndt, pers. comm., Jan. 4 and 13, 2010).

The first few prime Bell numbers occur at indices n=2, 3, 7, 13, 42, 55, 2841, ... (OEIS A051130), with no others less than 30447 (Weisstein, Apr. 23, 2006). These correspond to the numbers 2, 5, 877, 27644437, ... (OEIS A051131). B_(2841) was proved prime by I. Larrosa Canestro in 2004 after 17 months of computation using the elliptic curve primality proving program PRIMO.

BellNumbers

Bell numbers are closely related to Catalan numbers. The diagram above shows the constructions giving B_3=5 and B_4=15, with line segments representing elements in the same subset and dots representing subsets containing a single element (Dickau). The integers B_n can be defined by the sum

 B_n=sum_(k=0)^nS(n,k),
(1)

where S(n,k) is a Stirling number of the second kind, i.e., as the Stirling transform of the sequence 1, 1, 1, ....

The Bell numbers are given in terms of generalized hypergeometric functions by

 B_n=e^(-1)_(n-1)F_(n-1)(2,...,2_()_(n-1);1,...,1_()_(n-1);1)
(2)

(K. A. Penson, pers. comm., Jan. 14, 2007).

The Bell numbers can also be generated using the sum and recurrence relation

 B_n=sum_(k=0)^(n-1)B_k(n-1; k),
(3)

where (a; b) is a binomial coefficient, using the formula of Comtet (1974)

 B_n=[e^(-1)sum_(m=1)^(2n)(m^n)/(m!)]
(4)

for n>0, where [x] denotes the ceiling function. Dobiński's formula gives the nth Bell number

 B_n=1/esum_(k=0)^infty(k^n)/(k!).
(5)

A variation of Dobiński's formula gives

B_n=sum_(k=1)^(n)(k^n)/(k!)sum_(j=0)^(n-k)((-1)^j)/(j!)
(6)
=sum_(m=1)^(n)(m^n!(n-m))/(Gamma(m+1)Gamma(n-m+1))
(7)

where !n is a subfactorial (Pitman 1997).

A double sum is given by

 B_n=sum_(k=1)^nsum_(i=1)^k((-1)^(k-i)i^n)/(k!).
(8)

The Bell numbers are given by the generating function

G(x)=1/esum_(k=0)^(infty)1/((1-kx)k!)
(9)
=sum_(k=0)^(infty)(x^k)/((-x)^k((x-1)/x)_k)
(10)
=(_1F_1(-1/x;(x-1)/x;1))/e
(11)
=((-1)^(1/x)[xGamma(1-x^(-1))+Gamma(-x^(-1),-1)])/(ex)
(12)
=sum_(n=0)^(infty)B_nx^n
(13)
=1+x+2x^2+5x^3+15x^4+52x^5+...,
(14)

and the exponential generating function

 e^(e^x-1)=sum_(n=0)^infty(B_n)/(n!)x^n.
(15)

An amazing integral representation for B_n was given by Cesàro (1885),

B_n=(2n!)/(pie)I[int_0^pie^(e^(e^(ntheta)))sin(ntheta)dtheta]
(16)
=(2n!)/(pie)int_0^pie^(e^(costheta)cos(sint))sin[e^(costheta)sin(sintheta)]sin(ntheta)dtheta
(17)

(Becker and Browne 1941, Callan 2005), where I[z] denotes the imaginary part of z.

The Bell number B_n is also equal to phi_n(1), where phi_n(x) is a Bell polynomial.

de Bruijn (1981) gave the asymptotic formula

 (lnB_n)/n=lnn-lnlnn-1+(lnlnn)/(lnn)+1/(lnn)+1/2((lnlnn)/(lnn))^2+O[(lnlnn)/((lnn)^2)].
(18)

Lovász (1993) showed that this formula gives the asymptotic limit

 B_n∼n^(-1/2)[lambda(n)]^(n+1/2)e^(lambda(n)-n-1),
(19)

where lambda(n) is given by

 lambda(n)=n/(W(n)),
(20)

with W(n) the Lambert W-function (Graham et al. 1994, p. 493). Odlyzko (1995) gave

 B_n∼(n!)/(sqrt(2piW^2(n)e^(W(n))))(e^(e^(W(n))-1))/(W^n(n)).
(21)

Touchard's congruence states

 B_(p+k)=B_k+B_(k+1) (mod p),
(22)

when p is prime. This gives as a special case for k=0 the congruence

 B_p=2 (mod p)
(23)

for n prime. It has been conjectured that

 B_(n+(p^p-1)/(p-1))=B_n (mod p)
(24)

gives the minimum period of B_n (mod p). The sequence of Bell numbers {B_1,B_2,...} is periodic (Levine and Dalton 1962, Lunnon et al. 1979) with periods for moduli m=1, 2, ... given by 1, 3, 13, 12, 781, 39, 137257, 24, 39, 2343, 28531167061, 156, ... (OEIS A054767).

The Bell numbers also have the curious property that

|B_0 B_1 B_2 ... B_n; B_1 B_2 B_3 ... B_(n+1); | | | ... |; B_n B_(n+1) B_(n+2) ... B_(2n)|=product_(i=1)^(n)i!
(25)
=G(n+2)
(26)

(Lenard 1992), where the product is simply a superfactorial and G(n) is a Barnes G-function, the first few of which for n=0, 1, 2, ... are 1, 1, 2, 12, 288, 34560, 24883200, ... (OEIS A000178).

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.