keisoku

Stirling Numbers of the First Kind Calculator

Enter n and k to compute the unsigned c(n,k) and signed s(n,k) Stirling numbers of the first kind via recurrence. Exact BigInt arithmetic for large values.

Input

Enter n and k to compute the Stirling number of the first kind by recurrence. The main value is the unsigned c(n,k).

Integer of 0 or more (up to 170)

Integer from 0 up to n

Result

Unsigned c(6, 3)

225

Signed s(6, 3)

-225

n

6

k

3

Row of c(6, k) for k = 0 to 6

kUnsigned c(n, k)Signed s(n, k)
000
1120-120
2274274
3225-225
48585
515-15
611

How it works

  • Stirling numbers of the first kind count, in their unsigned form, the ways to arrange n elements into k disjoint cycles (permutations with k cycles).
  • The unsigned numbers c(n,k) follow the recurrence c(n,k)=c(n-1,k-1)+(n-1)c(n-1,k) with base case c(0,0)=1.
  • The signed numbers are s(n,k)=(-1)^(n-k) c(n,k); they are the coefficients when the falling factorial x(x-1)...(x-n+1) is expanded in powers of x.
  • Useful identities: c(n,n)=1, c(n,1)=(n-1)!, and c(n,0)=0 for n greater than 0 while c(0,0)=1.
  • Values grow rapidly with n, so the tool uses BigInt to keep results exact without floating point rounding.
  • Inputs must be integers with 0 less than or equal to k less than or equal to n, and n is capped at 170 to bound the computation.

Reviews

Tell us what you think of this calculator.

Write a review

  1. Home
  2. Stirling Numbers of the First Kind Calculator