Catalan Number Calculator

Calculate Catalan numbers and explore their many combinatorial applications.

Calculate C_n

C_5

42

= (2Ɨ5)! / ((5+1)! Ɨ 5!) = 10! / (6! Ɨ 5!)

Catalan Sequence

C0=1C1=1C2=2C3=5C4=14C5=42C6=132C7=429C8=1430C9=4862C10=16796C11=58786

Combinatorial Interpretations of C_5 = 42

Balanced Parentheses

42 ways to arrange 5 pairs

Binary Trees

42 different full binary trees with 6 leaves

Triangulations

42 ways to triangulate a polygon with 7 sides

Dyck Paths

42 paths from (0,0) to (25,0)

Mountain Ranges

42 mountain ranges with 5 upstrokes

Formulas

Direct Formula

C_n = (2n)! / ((n+1)! Ɨ n!)

Binomial Form

C_n = C(2n,n) / (n+1)

Recurrence

C_n = Ī£ C_i Ɨ C_(n-1-i)

Asymptotic

C_n ~ 4^n / (n^(3/2) Ɨ āˆšĻ€)

What Are Catalan Numbers?

Catalan numbers (C_n) form a sequence that counts an astonishing variety of combinatorial structures: valid parentheses expressions, binary trees, triangulations of polygons, Dyck paths, and more. The nth Catalan number is C_n = (2n)!/((n+1)!n!) = C(2n,n)/(n+1). The sequence begins 1, 1, 2, 5, 14, 42, 132, 429... This calculator uses BigInt arithmetic for exact computation of large Catalan numbers.

Catalan numbers appear in over 200 combinatorial counting problems — more than any other sequence except perhaps the Fibonacci numbers and binomial coefficients. Their ubiquity makes them a favorite topic in discrete mathematics and computer science algorithms courses.

Catalan Number Formula

Catalan Number

C_n = (2n)! / ((n+1)! Ɨ n!) = C(2n, n) / (n+1)

Where:

  • n= The index — a non-negative integer. Cā‚€ = 1, C₁ = 1, Cā‚‚ = 2, Cā‚ƒ = 5...

How to Use

  1. Enter n: The index of the Catalan number you want.
  2. Set sequence length: Control how many Catalan numbers are displayed in the sequence view.
  3. Read C_n: The nth Catalan number is displayed using BigInt for exact integer results.

Applications

Catalan numbers count valid parentheses: with n pairs of parentheses, there are C_n ways to arrange them properly. In binary trees, C_n counts the number of structurally different binary trees with n nodes. In computational geometry, C_n counts triangulations of an (n+2)-gon. In algorithm analysis, the number of ways to multiply n+1 matrices in a chain (parenthesization problem) is C_n. In ballot problems, C_n provides the number of ways n+1 votes for A and n votes for B can be counted with A never behind.

Worked Examples

Catalan for n=3

Problem:

Count the Catalan structures for n=3.

Solution Steps:

  1. 1Cā‚ƒ = 6!/4!3! = 720/(24Ɨ6) = 720/144 = 5.
  2. 25 valid parentheses: ()()(), (())(), ()(()), (()()), ((())).
  3. 35 binary trees with 3 nodes.

Result:

Cā‚ƒ = 5. Five ways to parenthesize 4 matrices: ((AB)C)D, (A(BC))D, (AB)(CD), A((BC)D), A(B(CD)).

Tips & Best Practices

  • āœ“C_n = C(2n,n) āˆ’ C(2n,n+1) — an alternative formula using binomial coefficients.
  • āœ“Catalan numbers grow roughly like 4^n / (n^(3/2) āˆšĻ€) — faster than exponential but slower than factorial.
  • āœ“For n=0, Cā‚€=1 (the empty structure counts as one).
  • āœ“The Catalan recurrence: C_{n+1} = Ī£_{i=0}^{n} C_i Ɨ C_{nāˆ’i} produces the same sequence.

Frequently Asked Questions

Catalan numbers are the 'universal' combinatorial sequence because many counting problems can be mapped to the same underlying recursive structure C_n = Ī£_{i=0}^{n-1} C_i Ɨ C_{n-1-i}. This recurrence describes all recursively-defined binary tree structures, which in turn model parentheses, Dyck paths, triangulations, and hundreds of other combinatorial objects.
The calculator uses JavaScript BigInt for factorial computation, so it can handle n up to around 50 before performance degrades noticeably. C_20 = 6,564,120,420 and C_50 overflows the integer display but is still computed exactly with BigInt.

Sources & References

Last updated: 2026-06-06

šŸ’”

Help us improve!

How would you rate the Catalan Number Calculator?

<>

Editorial Note

MyCalcBuddy Editorial Team

This page is maintained as an educational calculator reference.

Source

Formula Source: Handbook of Mathematical Functions

by Abramowitz & Stegun

UpdatedLast reviewed: May 2026
CheckedFormula checks are based on standard references and internal QA review.