On this page
Seat four friends at two identical round tables, nobody at an empty table, where only who sits to whose left matters. There are 11 ways. That 11 is a Stirling number of the first kind, and it also appears when you multiply out x(x + 1)(x + 2)(x + 3).
What are Stirling numbers of the first kind?
A permutation splits into cycles: follow 1 to where it goes, then onwards until you return to 1. The permutation 1→1, 2→3, 3→4, 4→2 is written (1)(234) and has two cycles. A round table is a cycle: each person points to their left-hand neighbour.
The unsigned Stirling number of the first kind, [n, k], is the number of permutations of n elements with exactly k cycles (OEIS A132393). The NIST handbook's signed version, s(n, k), is (−1)^(n−k) times that count (NIST DLMF §26.8).
The diagram at the top shows all 11 permutations of four elements with two cycles, as listed in OEIS A132393. Eight fix one element and cycle the other three (4 fixed elements times 2 directions); three pair the elements off.
How does the recurrence [n, k] = (n − 1)[n − 1, k] + [n − 1, k − 1] work?
OEIS A132393 lists this recurrence, and the DLMF gives the signed form as equation 26.8.18 (NIST DLMF §26.8). Follow the newest person, n:
Person n sits alone. The other n − 1 people fill k − 1 tables: [n − 1, k − 1] ways.
Person n joins a table. Seat the others at k tables, then put n to the left of any of them: (n − 1)[n − 1, k] ways.
In the second kind the multiplier is k, not n − 1, because a newcomer picks only a group, not a seat; see our explainer on Stirling numbers of the second kind.
What is the table of [n, k] up to n = 6?
These rows match OEIS A132393, reading k = 1 to n:
n = 1: 1
n = 2: 1, 1
n = 3: 2, 3, 1
n = 4: 6, 11, 6, 1
n = 5: 24, 50, 35, 10, 1
n = 6: 120, 274, 225, 85, 15, 1
Check one entry: [6, 3] = 5·[5, 3] + [5, 2] = 5·35 + 50 = 225.
Three checks catch slips. Each row sums to n! (OEIS A132393). The first entry is [n, 1] = (n − 1)!, from equation 26.8.14 in the DLMF. The second-last is [n, n − 1] = C(n, 2), from DLMF 26.8.16: one pair shares a table.
Why is x(x + 1)…(x + n − 1) the sum of [n, k]x^k?
The row polynomial is the rising factorial: [n, 1]x + [n, 2]x² + … + [n, n]xⁿ = x(x + 1)(x + 2)…(x + n − 1) (OEIS A132393). The DLMF writes the signed version with the falling factorial as equation 26.8.7 (NIST DLMF §26.8).
Try n = 4 by hand:
x(x + 1)(x + 2) = x³ + 3x² + 2x: row 3 backwards.
Multiply by (x + 3): x⁴ + 3x³ + 2x² + 3x³ + 9x² + 6x.
Collect: x⁴ + 6x³ + 11x² + 6x, which is row 4.
This is the recurrence in disguise: in the new factor (x + n − 1), the x means person n opens a table, and the n − 1 means they take one of n − 1 seats.
How are [n, 2] and harmonic numbers linked?
The DLMF gives s(n, 2) = (−1)ⁿ(n − 1)!(1 + 1/2 + … + 1/(n − 1)) as equation 26.8.15 (NIST DLMF §26.8). Unsigned, [n, 2] = (n − 1)!·H(n − 1), where H(m) = 1 + 1/2 + … + 1/m is the m-th harmonic number; OEIS A000254 lists the same column.
Check it: [4, 2] = 3!·(1 + 1/2 + 1/3) = 6·11/6 = 11, matching the table.
Why? The coefficient of x² in x(x + 1)…(x + n − 1) is the coefficient of x in (x + 1)…(x + n − 1). Take x from one bracket (x + j) and the constants from the rest: (n − 1)!/j. Adding over j = 1 to n − 1 gives (n − 1)!·H(n − 1).
A bonus from OEIS A000254: n!·H(n) is the total number of cycles across all permutations of n elements, so a random permutation has H(n) cycles on average.
For more practice with cycle notation, read why the 15 puzzle with two tiles swapped can't be solved. To revise permutations or harmonic numbers, the Fermi Concept Library covers every concept in physics, chemistry, biology, mathematics and computing. To practise, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer.



