Bell Number Calculator

Count the ways to split a labeled set into any number of nonempty groups, with the previous value shown.

Math and PercentUpdated 2026-11-183 min read
Bell Number Calculator
A whole number from 0 to 100.
Bell number B(n)
...
Previous Bell number...
Growth from previous...

What it does

A partition of a set divides its elements into nonempty groups that do not overlap. For a set of three labeled items there are five partitions: one group of three, three ways to pick a pair and a singleton, and one way to make three singletons. The Bell number B(n) counts all of them.

The sequence is named after Eric Temple Bell, a mathematician who wrote widely on combinatorics, though the values were known earlier. It begins 1, 1, 2, 5, 15, 52 and grows quickly, because the number of possible groupings rises far faster than the number of elements.

There are two common ways to compute a Bell number. The recurrence B(n + 1) equals the sum of binomial coefficients times earlier Bell numbers, and the Bell triangle fills values by repeated addition starting from 1. This page uses the triangle, which stays exact because no division is involved.

Each Bell number also equals the sum of the Stirling numbers of the second kind for that n, taken over every possible group count from one to n. That link makes the Bell page a natural companion to the Stirling page and explains why the two sequences share their early values.

The input limit is 100, which produces an integer with more than one hundred digits. The tool prints every digit, so no precision is lost, and it shows the previous Bell number and the ratio between the two for context.

How to use

  1. Enter a set size n from 0 to 100.
  2. Read B(n) from the main result box.
  3. Check the previous value beside it to see the step before yours.
  4. Use the growth ratio to see how fast the counts are climbing.
  5. The page opens on n = 5 so the worked example is already loaded.
  6. Try n = 10 to confirm the value 115,975.

Formula

B(0) = 1; B(n + 1) = sum from k = 0 to n of C(n, k) x B(k)
n
The number of labeled elements in the set.
B(n)
The number of partitions of an n element set.
C(n, k)
The binomial coefficient counting choices of k elements from n.

The Bell triangle gives the same answer using only addition. Put 1 in the first row. Each new row starts with the last value of the previous row, and every following entry is the sum of the value to its left and the value above that left neighbor. The first entry of a row is the Bell number for that row index. The triangle avoids large intermediate products, so all values stay exact.

Worked example

Example: B(5)

The tool is set to n = 5 on first load.

  1. Start with B(0) = 1.
  2. Compute B(1) = C(0, 0) x B(0) = 1.
  3. Compute B(2) = C(1, 0) x 1 + C(1, 1) x 1 = 2.
  4. Compute B(3) = 1 x 1 + 2 x 1 + 1 x 2 = 5.
  5. Compute B(4) = 1 x 1 + 3 x 1 + 3 x 2 + 1 x 5 = 15.
  6. Compute B(5) = 1 x 1 + 4 x 1 + 6 x 2 + 4 x 5 + 1 x 15 = 52.
  7. The tool reports 52, previous value 15, and growth 3.47x.

Reference table

Bell numbers for small sets
nB(n)PreviousGrowth
01n/an/a
1111.00x
2212.00x
3522.50x
41553.00x
552153.47x
10115975211475.48x

Limits

  • The elements are labeled, so swapping labels can create a new partition.
  • Inputs above 100 are rejected to keep the printed integer readable.
  • The tool does not list the individual partitions, only how many there are.
  • Group order is ignored, as in the standard definition.

Common mistakes

  • Counting the order of the groups, which gives ordered Bell numbers instead.
  • Allowing empty groups, which is not part of a partition.
  • Confusing B(n) with the number of surjections onto a fixed set of groups.
  • Using B(n) = n times B(n - 1), which overcounts.
  • Assuming every Bell number is odd because the first few are small.

Try it yourself

Quick checks. Answers sit tucked under each question.

What is B(0)?

B(0) = 1, the single partition of the empty set with no groups.

What is B(5)?

B(5) = 52, and the previous value B(4) is 15.

What is B(10)?

B(10) = 115,975, which is 5.48 times B(9) = 21,147.

Questions

What is a set partition?

A division of the elements into nonempty groups that do not overlap and together contain every element.

Why does B(1) equal 1?

A single element can only form one group, so there is exactly one partition.

How are Bell and Stirling numbers related?

B(n) is the sum of S(n, k) over all valid k, since those counts split partitions by their number of groups.

What is the Bell triangle?

A triangular array built by additions whose leading entry in each row is the corresponding Bell number.

Do the values stay exact?

Yes. The triangle uses only integer addition, so even B(100) is printed with no rounding.

What input range does this page allow?

Whole numbers from 0 through 100, with a clear error outside that interval.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.