Stirling Numbers of the Second Kind Table
Enter a maximum order N to generate the triangular table of Stirling numbers of the second kind S(n,k) from n=0 to N, with the row sums (Bell numbers) shown alongside.
Input
Enter a maximum order N to generate the triangular table of Stirling numbers of the second kind S(n,k) from n=0 to N. The sum of each row (the Bell number) is shown too.
Enter an integer from 0 to 30.
Result
Bell number B(8) (sum of row n=8)
4,140
Triangle of Stirling numbers of the second kind S(n,k)
| n / k | k=0 | k=1 | k=2 | k=3 | k=4 | k=5 | k=6 | k=7 | k=8 | Bell |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 1 | 1 | ||||||||
| 1 | 0 | 1 | 1 | |||||||
| 2 | 0 | 1 | 1 | 2 | ||||||
| 3 | 0 | 1 | 3 | 1 | 5 | |||||
| 4 | 0 | 1 | 7 | 6 | 1 | 15 | ||||
| 5 | 0 | 1 | 15 | 25 | 10 | 1 | 52 | |||
| 6 | 0 | 1 | 31 | 90 | 65 | 15 | 1 | 203 | ||
| 7 | 0 | 1 | 63 | 301 | 350 | 140 | 21 | 1 | 877 | |
| 8 | 0 | 1 | 127 | 966 | 1,701 | 1,050 | 266 | 28 | 1 | 4,140 |
The rightmost cell of each row is the Bell number, equal to that row sum. Cells where k exceeds n are blank because no such partition exists.
How it works
- The Stirling number of the second kind S(n,k) counts the number of ways to partition a set of n distinguishable elements into k non-empty, unlabeled subsets. It is a fundamental quantity in combinatorics and set partition theory.
- This tool fills the lower-triangular table using the recurrence S(n,k) = k * S(n-1,k) + S(n-1,k-1), starting from S(0,0)=1 and setting S(n,0)=0 for n greater than or equal to 1.
- Every value is computed with BigInt (arbitrary-precision integers), so even at higher orders there is no overflow or rounding error and the results are exact integers.
- The sum of each row, S(n,0)+S(n,1)+…+S(n,n), equals the Bell number B(n), which is the total number of partitions of an n-element set. The Bell number appears in the rightmost column of the table.
- The maximum order N must be between 0 and 30 inclusive. Columns are indexed by k and rows by n; cells where k exceeds n are left blank because no such partition exists.
Reviews
Tell us what you think of this calculator.
Write a review
- Home
Stirling Numbers of the Second Kind Table