Stirling Numbers of the First Kind Calculator
Inputs
- The unsigned Stirling numbers of the first kind, c(n, k), count the permutations of n elements that split into exactly k cycles.
- They follow the recurrence c(n, k) = c(n-1, k-1) + (n-1) x c(n-1, k): element n either forms its own cycle or is inserted into an existing one.
- Filling the table to row 6 gives c(6, 3) = 225.
- That is 31.25 percent of all 720 permutations of 6 elements; the signed number s(6, 3) attaches the sign of the permutation parity, giving -225.
This stirling numbers of the first kind calculator finds the unsigned Stirling numbers of the first kind, written c(n, k), which count the permutations of n elements that split into exactly k cycles. Enter n and k and the page returns the value directly. For instance, c(6, 3) = 225, which is 31.25 percent of all 720 permutations of six elements. Two more values show how the numbers grow: c(5, 2) = 50 and c(7, 4) = 735. The calculator also reports the signed numbers s(n, k), which attach a sign by permutation parity, so s(6, 3) = -225.
The underlying method is the standard recurrence c(n, k) = c(n-1, k-1) + (n-1) x c(n-1, k). It works by asking whether element n forms its own cycle or joins an existing one, and that case split is why the recurrence is the accepted way to build these numbers exactly rather than by estimation. This page shows the formula, step-by-step workings, worked examples and sources, so you can follow how each result is produced and check it against the definition of cycles in a permutation.
Worked examples
Six elements, three cycles
(6 · 3)
| Unsigned Stirling number c(6, 3) | 225 |
| Signed Stirling number s(6, 3) | -225 |
| Row total (n! permutations) | 720 |
| Share of all permutations | 31.25% |
Five elements, two cycles
(5 · 2)
| Unsigned Stirling number c(5, 2) | 50 |
| Signed Stirling number s(5, 2) | -50 |
| Row total (n! permutations) | 120 |
| Share of all permutations | 41.67% |
Seven elements, four cycles
(7 · 4)
| Unsigned Stirling number c(7, 4) | 735 |
| Signed Stirling number s(7, 4) | -735 |
| Row total (n! permutations) | 5,040 |
| Share of all permutations | 14.58% |
Counting permutations by their cycles
Every permutation of a set can be written as a product of disjoint cycles, and that cycle decomposition is unique up to the order in which you list the cycles. Take the six elements 1 through 6. One permutation might send 1 to 3, 3 to 5, and 5 back to 1, forming the cycle (1 3 5); send 2 to 4 and 4 back to 2, forming (2 4); and leave 6 fixed, forming (6). That permutation splits into exactly three cycles. Another permutation on the same six elements might be a single cycle of length six, or six separate fixed points. The number of cycles is a genuine structural property of the permutation, not an artifact of how you write it down.
This is why counting permutations by their cycle count is natural. The unsigned Stirling numbers of the first kind, written c(n, k), count exactly the permutations of n elements that split into exactly k cycles. For six elements and three cycles, c(6, 3) = 225. That is 31.25 percent of all 720 permutations of six elements, so nearly a third of the permutations of six objects break into exactly three cycles. A stirling numbers of the first kind calculator returns values like this one directly, without your having to enumerate permutations by hand.
The numbers build up through a simple recurrence: c(n, k) = c(n-1, k-1) + (n-1) x c(n-1, k). The reasoning is a single question about element n. Either n forms its own cycle, in which case the remaining n-1 elements must split into k-1 cycles, giving the first term. Or n joins an existing cycle among the permutations of the other n-1 elements, and there are n-1 places to insert it into a cycle, giving the second term. Starting from small cases, this rule produces the whole table. For instance, c(5, 2) = 50 and c(7, 4) = 735.
The same counting appears with signs attached. The signed Stirling numbers of the first kind, s(n, k), carry a sign determined by the parity of the permutation, so s(6, 3) = -225. The magnitude is unchanged; only the sign differs, which is why the unsigned version is the one usually wanted when you are simply counting cycle structures. Whether you are checking a homework problem, exploring combinatorics, or verifying a value from the recurrence, the cycle-counting view keeps the meaning of each entry clear.
- c(6, 3) = 225: permutations of six elements with exactly three cycles
- 225 is 31.25 percent of all 720 permutations of six elements
- c(5, 2) = 50 and c(7, 4) = 735
- s(6, 3) = -225: the signed value, same magnitude with a sign from permutation parity
The recurrence that builds the table
The unsigned Stirling numbers of the first kind, written c(n, k), count the permutations of n elements that split into exactly k cycles. The quickest way to see how these numbers arise is to build them row by row. The recurrence c(n, k) = c(n-1, k-1) + (n-1) × c(n-1, k) comes from a single question about element n: does it form its own cycle, or does it join an existing one?
If element n starts a new cycle, then the remaining n-1 elements must already form k-1 cycles, which gives the term c(n-1, k-1). If instead element n joins an existing cycle, it can be inserted in any of the n-1 possible positions relative to the other elements, and the remaining n-1 elements must already form k cycles. That gives the term (n-1) × c(n-1, k). Adding the two cases produces the recurrence. This is exactly the logic a stirling numbers of the first kind calculator uses to fill a table from small n up to the value you request.
The recurrence lets you generate the table one row at a time. For example, c(5, 2) = 50 and c(7, 4) = 735. A worked case shows how the pieces combine: c(6, 3) = 225, which is 31.25 percent of all 720 permutations of six elements. The signed numbers s(n, k) attach a sign by permutation parity; for instance, s(6, 3) = -225, the negative of the unsigned value.
| n | k | c(n, k) |
|---|---|---|
| 5 | 2 | 50 |
| 6 | 3 | 225 |
| 7 | 4 | 735 |
Signed versus unsigned
The unsigned Stirling numbers of the first kind, written c(n, k), count the permutations of n elements that split into exactly k cycles. The signed Stirling numbers of the first kind, written s(n, k), use the same cycle count but attach a sign that depends on the parity of the permutation. In other words, the sign is not a separate combinatorial idea — it is a plus or minus laid over the same count.
The rule is simple once you see it: s(n, k) equals c(n, k) with a sign determined by permutation parity. When you run a stirling numbers of the first kind calculator, the unsigned value is the raw count of permutations with k cycles, and the signed value is that count with the parity sign applied. The clearest example is s(6, 3) = -225, which is exactly the unsigned c(6, 3) = 225 carrying a negative sign. The magnitude is identical; only the sign changes.
Where does the signed version show up? In falling factorials. The signed Stirling numbers of the first kind are the coefficients that expand a falling factorial into powers of the variable, so the signs come out naturally in that polynomial expansion. This is why the signed form matters in algebra even though the unsigned form is the one that directly counts cycle structures.
The unsigned numbers follow the recurrence c(n, k) = c(n-1, k-1) + (n-1) x c(n-1, k). The logic behind it is a choice about element n: either it forms its own cycle, which corresponds to the c(n-1, k-1) term, or it joins one of the existing cycles, which gives the (n-1) x c(n-1, k) term. The signed numbers obey the same recurrence with the sign carried along, so the two versions stay paired at every step.
Because the signed and unsigned versions share a magnitude, you can always move between them by tracking parity. A quick sanity check with known values helps: c(5, 2) = 50 and c(7, 4) = 735 are unsigned counts, and the signed counterparts differ only in sign. For c(6, 3) = 225, that count is 31.25 percent of all 720 permutations of six elements — a useful reminder that the unsigned number is a proportion of the full permutation set, while the signed number is the same proportion with a parity sign attached.
- Unsigned c(n, k): counts permutations of n elements with exactly k cycles.
- Signed s(n, k): the same count with a sign set by permutation parity.
- Example: s(6, 3) = -225, matching unsigned c(6, 3) = 225 in magnitude.
- Reference values: c(5, 2) = 50 and c(7, 4) = 735 (unsigned).
- Signed numbers appear as coefficients in falling factorial expansions.
First kind versus second kind
The first kind and the second kind of Stirling numbers answer different questions, even though both are indexed by two numbers, n and k. The unsigned Stirling numbers of the first kind, written c(n, k), count the permutations of n elements that split into exactly k cycles. The second kind counts something else entirely: the ways to divide a set of n elements into exactly k nonempty subsets, or blocks. A permutation's cycles care about order — who follows whom around the loop — while a partition into subsets does not. That single difference decides which table you need, so it is worth checking before you type numbers into a stirling numbers of the first kind calculator.
The recurrence for the first kind shows where the cycles come from. It reads c(n, k) = c(n-1, k-1) + (n-1) x c(n-1, k). The reasoning is a simple question about element n: either it forms a cycle all by itself, which leaves n-1 elements arranged into k-1 cycles, or it joins one of the existing cycles, and there are n-1 places to insert it among the n-1 elements already placed. The second kind's recurrence has a similar shape but a different multiplier, because adding an element to a subset offers different choices than inserting it into a cycle. If you are counting subsets, the first-kind table will give you the wrong answer.
A worked example makes the first kind concrete. c(6, 3) = 225, meaning 225 of the 720 permutations of six elements split into exactly three cycles. That works out to 31.25 percent of all 720 permutations. Two more values help you sanity-check a table: c(5, 2) = 50 and c(7, 4) = 735. Notice how quickly the numbers grow as n rises, which is one reason a calculator is more convenient than working the recurrence by hand.
There is also a signed version. The signed numbers s(n, k) attach a sign according to permutation parity, so s(6, 3) = -225. The magnitude matches the unsigned count; only the sign changes. If your problem involves determinants or signs, reach for the signed table, and if it involves plain counts of cycles, use the unsigned one.
- First kind, c(n, k): permutations of n elements with exactly k cycles — order around each cycle matters.
- Second kind: ways to split n elements into exactly k nonempty subsets — order within a subset does not matter.
- First-kind recurrence: c(n, k) = c(n-1, k-1) + (n-1) x c(n-1, k).
- Check values: c(6, 3) = 225, c(5, 2) = 50, c(7, 4) = 735.
- Signed version: s(n, k) carries a sign from permutation parity, so s(6, 3) = -225.
FAQs
What do Stirling numbers of the first kind count?
The unsigned Stirling number of the first kind, written c(n, k), counts the permutations of n elements that have exactly k cycles. So each entry in the table tells you how many ways n items can be arranged into k separate cycles. The signed version, s(n, k), carries the same count with a plus or minus sign attached.
What is c(6, 3)?
c(6, 3) is 225. That means 225 of the 720 permutations of six elements have exactly three cycles. As a share of all six-element permutations, 225 is 31.25 percent of 720, so roughly a third of them land on three cycles.
How is the table built?
The table is built with the recurrence c(n, k) = c(n-1, k-1) + (n-1) x c(n-1, k). Element n either forms its own cycle, which gives the first term, or it is inserted into an existing cycle, which gives the second term. Working upward from the base row fills the whole triangle.
What is the signed Stirling number?
The signed Stirling number s(n, k) is c(n, k) with the sign of the permutation parity applied. For example, s(6, 3) = -225 because 6 - 3 is odd, so the sign is negative. When n - k is even, the sign stays positive and s(n, k) equals c(n, k).
Do the row entries add up?
Yes. Summing c(n, k) over all values of k in a row gives n!, the total number of permutations. For n = 6 the row adds up to 720, matching 6! exactly. This works because every permutation of n elements has some number of cycles, so the cycle counts split the full set.
Where are they used?
Stirling numbers of the first kind appear in the expansion of falling and rising factorials, in combinatorics, and in the analysis of random permutations. In each setting they track how elements group into cycles, which is why the same numbers show up across these different areas of mathematics.