Stirling numbers table (first & second kind)

Explore S(n,k), s(n,k), and c(n,k) in a triangle table. Tap any cell to see its meaning, recurrence, and related identities.

The Bell numbers tab is also available here, so you can jump between partitions and cycle counts without leaving the page.

Other languages: en | ja | es

How to use (3 steps)

  1. Select the type (S, s, c, or Bell) and set nMax.
  2. Choose Exact or Mod and enter the modulus if needed.
  3. Tap a cell to read its meaning, then export or share the table.
Type

Definitions & recurrences

Example values

FAQ

What is the Stirling number of the second kind?

S(n,k) counts the number of ways to partition n labeled elements into k non-empty subsets.

What is the Stirling number of the first kind, and how do signed/unsigned differ?

c(n,k) counts permutations of n elements with k cycles. The signed version s(n,k) applies a sign (-1)^{n-k}.

How are Bell numbers related to Stirling numbers?

Bell numbers satisfy B(n)=Σ S(n,k), so each Bell number is the row sum of the second-kind table.

Why use modulo mode?

Exact values grow quickly; modulo mode keeps numbers small for programming contests and algorithm checks.

Why is there a limit on nMax?

Exact values become huge and large tables are costly to render, so the calculator clamps nMax for stability.

Can I export the table?

Yes. Use the CSV or TSV export buttons to download the full table.

Related