How to use (3 steps)
- Select the type (S, s, c, or Bell) and set nMax.
- Choose Exact or Mod and enter the modulus if needed.
- Tap a cell to read its meaning, then export or share the table.
Definitions & recurrences
- S(n,k) ({ n \ k }) partitions n labeled elements into k non-empty blocks. Recurrence: S(n,k)=S(n-1,k-1)+kS(n-1,k).
- c(n,k) ([ n \ k ]) counts permutations with k cycles. Recurrence: c(n,k)=c(n-1,k-1)+(n-1)c(n-1,k).
- s(n,k) is the signed version with s(n,k)=(-1)^{n-k}c(n,k).
- Bell numbers are row sums: B(n)=Σ S(n,k).
- Bell recurrence: B(n+1)=Σ C(n,k)B(k).
Example values
- S(5,2)=15 (two non-empty blocks).
- c(4,2)=11 (permutations of 4 elements with 2 cycles).
- Bell(5)=52 (total partitions of 5 elements).
FAQ
What is the Stirling number of the second kind?
S(n,k) counts the number of ways to partition n labeled elements into k non-empty subsets.
What is the Stirling number of the first kind, and how do signed/unsigned differ?
c(n,k) counts permutations of n elements with k cycles. The signed version s(n,k) applies a sign (-1)^{n-k}.
How are Bell numbers related to Stirling numbers?
Bell numbers satisfy B(n)=Σ S(n,k), so each Bell number is the row sum of the second-kind table.
Why use modulo mode?
Exact values grow quickly; modulo mode keeps numbers small for programming contests and algorithm checks.
Why is there a limit on nMax?
Exact values become huge and large tables are costly to render, so the calculator clamps nMax for stability.
Can I export the table?
Yes. Use the CSV or TSV export buttons to download the full table.