Catalan number calculator
Enter n from 0 to 2000. The number is computed exactly with big integers, so even very long results have every digit correct and can be copied in full.
Runs in your browser: nothing you enter is sent anywhere.
How to use it
- Type n.
- Read Cₙ, the digit count and the approximate size.
- Use the table for the first 21 values.
How it works
The calculator starts from C₀ = 1 and applies Cₖ₊₁ = Cₖ × 2(2k + 1) / (k + 2) with big integers, so there is no rounding at any size.
Worked example
C₅ = 10! / (6! × 5!) = 42. A 5-pair bracket sequence has 42 valid arrangements. C₁₀ = 16796 and C₂₀ = 6 564 120 420. C₁₀₀ has 57 digits.
Tips
- Cₙ is also the number of binary trees with n nodes.
- The table lists C₀ to C₂₀ whatever n you enter.
Frequently asked questions
What is a Catalan number?
The sequence 1, 1, 2, 5, 14, 42, 132 and so on. Cₙ counts many things, such as the ways to place n pairs of brackets correctly, or to split a polygon of n + 2 sides into triangles.
What is the formula?
Cₙ = (2n)! / ((n + 1)! × n!), which equals the binomial C(2n, n) / (n + 1). The calculator uses Cₖ₊₁ = Cₖ × 2(2k + 1) / (k + 2), which divides exactly at every step.
Why is the value shortened?
Very long results would not fit on screen, so more than 40 digits are shown as the first 24 and last 8 digits. The copy button copies every digit.
How fast do Catalan numbers grow?
About 4 times larger with each step, roughly 4ⁿ / (n^1.5 × √π).