Connect via MCP →

Enter Calculation

Non-negative integer (0 to 25). The tool returns the SIGNED Stirling numbers of the first kind s(n,k) for k = 0..n.

Formula

Advertisement

Results

Signed Stirling numbers of the first kind, row n = 5
s(5, k) for k = 0 ... 5
Signed convention: s(n,k) = (-1)^(n-k) c(n,k)
k s(n, k)
0 0
1 24
2 -50
3 35
4 -10
5 1
Signed sum 0
Sum of absolute values (= n!) 120

What this calculator does

This tool computes the complete row of signed Stirling numbers of the first kind, written \(s(n,k)\), for a non-negative integer \(n\) that you supply. It outputs every value for k = 0, 1, 2, ..., n in a table, along with the signed sum of the row and the sum of absolute values. The signed convention is used here: \(s(n,k)\) may be positive or negative. The unsigned (or "cycle count") numbers \(c(n,k) = |s(n,k)|\) count the permutations of \(n\) elements having exactly \(k\) disjoint cycles, and are related by \(s(n,k) = (-1)^{n-k} c(n,k)\).

The formula

The signed Stirling numbers of the first kind are the coefficients in the expansion of the falling factorial \((x)_n = x(x-1)(x-2)\cdots(x-n+1) = \sum_k s(n,k)\, x^k\). They satisfy the recurrence $$s(n,k) = s(n-1,k-1) - (n-1)\,s(n-1,k)$$ with base cases \(s(0,0) = 1\), \(s(n,0) = 0\) for \(n \geq 1\), and \(s(n,k) = 0\) when \(k < 0\) or \(k > n\). Note that \(s(n,n) = 1\) always.

Triangular table of Stirling numbers of the first kind with arrows showing the recurrence
The recurrence builds each entry from two cells in the row above: \(s(n-1,k-1)\) and \(s(n-1,k)\).

How to use it

Enter an integer \(n\) between 0 and 25 and submit. The calculator builds the rows by dynamic programming starting from [1] for \(n = 0\) and reading off the final row. Use the signed sum (0 for \(n \geq 2\)) and the absolute sum (equal to \(n!\)) as quick correctness checks.

Advertisement

Worked example (n = 5)

Building the rows: n=1 gives [0, 1]; n=2 gives [0, -1, 1]; n=3 gives [0, 2, -3, 1]; n=4 gives [0, -6, 11, -6, 1]; and n=5 gives [0, 24, -50, 35, -10, 1]. Check: $$|0|+|24|+|50|+|35|+|10|+|1| = 120 = 5!,$$ and the signed sum \(0+24-50+35-10+1 = 0\).

Row of signed Stirling numbers for n equals 5 with alternating signs
The n = 5 row: values 0, 24, -50, 35, -10, 1 with alternating signs across k = 0..5.

FAQ

Signed or unsigned? This tool returns the signed values. To get the unsigned cycle counts \(c(n,k)\), take absolute values.

Why does the signed sum equal 0? Substituting \(x = 1\) in the falling factorial gives \((1)_n = 0\) for \(n \geq 2\), which equals the row sum of \(s(n,k)\).

Why is the maximum n limited? Values grow factorially, so the magnitudes get very large quickly; \(n\) is capped at 25 to keep the table readable and the arithmetic reliable.

Last updated: