Stirling Number Calculator
Calculate Stirling numbers of the first and second kind, plus Bell numbers for set partitions.
Inputs
Results
Stirling Number S(n,k)
25
Bell Number B(n)
52
How to Use This Calculator
- Enter n and k — the Stirling number S(n, k) counts a specific combinatorial structure.
- Select Kind: First (signed cycle decompositions) or Second (partitions into non-empty subsets).
- Review the Stirling Number S(n, k) for the selected kind.
- Check Bell Number B(n) — the sum of all Stirling numbers of the second kind for a given n.
- Use Stirling numbers in combinatorics, probability, and the analysis of divide-and-conquer algorithms.
How the result changes with n
| n | Stirling Number S(n,k) | Bell Number B(n) |
|---|---|---|
| 2.5 | 1 | 5 |
| 8.75 | 3,025 | 21,147 |
| 16 | 7,141,686 | 10,480,142,147 |
| 23 | 15,686,335,501 | 44,152,005,855,084,344 |
What each input means
- n
- Size of the set (max 25 to avoid overflow)
- k
- Number of cycles (1st kind) or blocks/partitions (2nd kind)
- Kind (1=First, 2=Second)
- Stirling number kind: 1st (permutation cycles) or 2nd (set partitions)
How this is calculated
Worked example, using the default values
- Identify Input Parametersn = 5, k = 3, Kind (1=First, 2=Second) = 2 = 3 input(s) provided
- Calculate Stirling Number SStirling Number S25 = 25
- Calculate Bell Number BBell Number B52 = 52
Engine last updated . Checked against 7 independently-derived tests — how we verify calculators.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
Discrete Mathematics
Integer Partition Calculator
Count the number of integer partitions of n with optional constraints on maximum part size and distinctness.
Discrete MathematicsPermutations & Combinations Calculator
Calculate permutations and combinations with or without repetition for any n and r values.
Discrete MathematicsBinomial Coefficient Calculator
Calculate nCr and nPr values with Pascal's triangle row visualization.
More in Math & Statistics.