46.3 Bell

Bell( n )

Bell returns the Bell number B(n). The Bell numbers are defined by B(0)=1 and the recurrence B(n+1) = sum_{k=0}^{n}{{n choose k}B(k)}.

B(n) is the number of ways to partition a set of n elements into pairwise disjoint nonempty subsets (see PartitionsSet). This implies of course that B(n) = sum_{k=0}^{n}{S_2(n,k)} (see Stirling2). B(n)/n! is the coefficient of x^n in the formal series e^{e^x-1}, which is the generating function for B(n).

    gap> List( [0..6], n -> Bell( n ) );
    [ 1, 1, 2, 5, 15, 52, 203 ]
    gap> Bell( 14 );
    190899322 

Previous Up Top Next
Index

GAP 3.4.4
April 1997