Bell Number Sequence Generator
Generate Bell number sequences using the Bell triangle algorithm with BigInt precision. Compute B(0) through B(100) instantly with full triangle visualization.
About
Bell numbers count the number of ways to partition a set of n elements into non-empty subsets. B(0) = 1 by convention. B(3) = 5 because the set {1, 2, 3} has exactly five partitions. Growth is super-exponential: B(15) = 1,382,958,545 already exceeds 109, and B(25) surpasses 1018, overflowing standard 64-bit integers. This generator uses the Bell triangle (Aitken’s array) with arbitrary-precision BigInt arithmetic, so every digit is exact through B(100) and beyond. Miscounting partitions propagates errors in combinatorial optimization, database query planning, and Bayesian network structure enumeration.
The tool also renders the full Bell triangle so you can trace how each value derives from its neighbors. Note: computation is exact but display of B(100) - a 116-digit number - may wrap on narrow screens. Pro tip: Bell numbers satisfy Dobinski’s formula and appear in moment calculations of the Poisson distribution with λ = 1.
Formulas
Bell numbers are computed via the Bell triangle (also called Aitken’s array or the Peirce triangle). Construct a triangular array where each row yields the next Bell number.
a0,0 = 1
an,0 = an−1,n−1
an,k = an,k−1 + an−1,k−1
B(n) = an,0
Where an,k is the element at row n, column k of the Bell triangle. The Bell number B(n) is the first element of row n.
An equivalent closed-form is Dobinski’s formula:
Where e is Euler’s number (2.71828...). This formula converges but is impractical for exact integer computation. The Bell triangle method is preferred for its O(n2) time complexity and exact BigInt results.
The recurrence relation connecting consecutive Bell numbers uses Stirling numbers of the second kind S(n,k):
Where S(n, k) counts partitions of n elements into exactly k non-empty subsets.
Reference Data
| n | B(n) | Digits | Context |
|---|---|---|---|
| 0 | 1 | 1 | Empty set: one trivial partition |
| 1 | 1 | 1 | Singleton set |
| 2 | 2 | 1 | {1,2} or {1},{2} |
| 3 | 5 | 1 | Five partitions of a 3-element set |
| 4 | 15 | 2 | Equivalent to OEIS A000110(4) |
| 5 | 52 | 2 | Used in Faa di Bruno’s formula |
| 6 | 203 | 3 | Number of rhyme schemes for 6 lines |
| 7 | 877 | 3 | Equivalence relations on 7 elements |
| 8 | 4,140 | 4 | Surjection count related |
| 9 | 21,147 | 5 | Database join orderings |
| 10 | 115,975 | 6 | Exceeds 105 |
| 15 | 1,382,958,545 | 10 | Exceeds 32-bit integer max |
| 20 | 51,724,158,235,372 | 14 | Requires 64-bit integer |
| 25 | 4,638,590,332,229... | 19 | Overflows uint64 |
| 30 | 8.46 × 1023 | 24 | Requires BigInt / arbitrary precision |
| 40 | 1.58 × 1035 | 36 | Combinatorial explosion regime |
| 50 | 1.86 × 1047 | 48 | Practical enumeration impossible |
| 60 | 9.76 × 1059 | 60 | Astrophysical-scale count |
| 70 | 1.66 × 1073 | 74 | Exceeds atoms in observable universe |
| 80 | 8.58 × 1086 | 87 | Cryptographic-scale magnitude |
| 90 | 1.28 × 10101 | 102 | Googol surpassed |
| 100 | 4.76 × 10115 | 116 | Maximum in this tool |