Catalan Number Calculator

Catalan number C(5)42
Central binomial coefficient C(10, 5)252
Divisor (n + 1)6
Previous Catalan number14
How this was calculated
  1. Catalan numbers: C(n) = C(2n, n) / (n + 1). Here C(10, 5) = 252.
  2. Divide by n + 1 = 6: 252 / 6 = 42.
  3. Equivalently, the recurrence C(k+1) = C(k) × 2(2k + 1) / (k + 2) builds the same value one exact integer step at a time.

This Catalan number calculator computes C(n) for any nonnegative integer n you enter. The Catalan numbers follow the sequence 1, 1, 2, 5, 14, 42, 132, 429, ... and are defined by the formula C(n) = C(2n, n) / (n + 1). For example, C(5) = 42, which comes from the binomial coefficient C(10, 5) = 252 divided by 6. C(10) = 16,796, from C(20, 10) = 184,756 divided by 11. C(19) = 1,767,263,190, from C(38, 19) = 35,345,263,800 divided by 20. This is sequence A000108 in the OEIS. The same number counts many structures at once: the ways to bracket a product of n + 1 factors, the binary trees with n internal nodes, the triangulations of a polygon with n + 2 sides, and the lattice paths from (0,0) to (n,n) that never rise above the diagonal (Dyck paths).

The accepted standard method for computing Catalan numbers uses the recurrence C(n+1) = C(n) × 2(2n + 1) / (n + 2), which builds each value from the last with exact integer arithmetic at every step. The sequence is named after Eugène Charles Catalan, who studied the bracketing problem in 1838, though Euler had met the same numbers earlier in the polygon triangulation problem. This page shows the formula, step-by-step workings, worked examples, and sources.

Worked examples

Five pairs of brackets

Primary result: 42 — the 252 ways to choose 10 items taken 5 at a time, divided by 6. (5)

Catalan number C(5)42
Central binomial coefficient C(10, 5)252
Divisor (n + 1)6
Previous Catalan number14

The tenth Catalan number

Primary result: 16,796 — from the binomial coefficient 184,756 divided by 11. (10)

Catalan number C(10)16,796
Central binomial coefficient C(20, 10)184,756
Divisor (n + 1)11
Previous Catalan number4,862

Nineteen

Primary result: 1,767,263,190 — over 1.7 billion structures from a modest n of 19. (19)

Catalan number C(19)1,767,263,190
Central binomial coefficient C(38, 19)35,345,263,800
Divisor (n + 1)20
Previous Catalan number477,638,700

One sequence, many disguises

Pick up a pencil and try to count the ways to bracket a product of factors, the shapes of binary trees with a given number of internal nodes, and the triangulations of a polygon. At first glance these look like three completely different problems. They are not. Each count produces the same list of numbers: 1, 1, 2, 5, 14, 42, 132, 429, and so on, the sequence catalogued as A000108 in the OEIS. A Catalan number calculator can reveal this shared structure in an instant, but the surprise is worth slowing down to appreciate.

The formula behind the sequence is C(n) = C(2n, n) / (n + 1), where C(2n, n) is a binomial coefficient. Because the division is always exact, every term is a whole number. The same value C(n) answers several questions at once. It gives the ways to bracket a product of n + 1 factors, the count of binary trees with n internal nodes, the triangulations of a polygon with n + 2 sides, and the lattice paths from (0,0) to (n,n) that never rise above the diagonal, known as Dyck paths. Four settings, one answer.

A few checked values show how quickly the numbers climb. C(5) equals 42, obtained from C(10, 5) = 252 divided by 6. C(10) equals 16,796, from C(20, 10) = 184,756 divided by 11. C(19) equals 1,767,263,190, from C(38, 19) = 35,345,263,800 divided by 20. The recurrence C(n+1) = C(n) × 2(2n + 1) / (n + 2) builds each value from the last with exact integer arithmetic at every step, so there is no need to compute large binomial coefficients directly.

The sequence is named after Eugène Charles Catalan, who studied the bracketing problem in 1838. Leonhard Euler had met the same numbers earlier, through the polygon triangulation problem. Neither researcher was looking for a sequence that would later appear in trees and lattice paths. The connection emerged as mathematicians recognized that the same counts surfaced again and again in different settings, each one a fresh disguise for the same underlying structure.

The Catalan formula

The Catalan formula is C(n) = C(2n, n) / (n + 1), where C(2n, n) is a binomial coefficient. This single expression produces every Catalan number, sequence A000108 in the OEIS: 1, 1, 2, 5, 14, 42, 132, 429, and so on. A Catalan number calculator uses this formula directly, computing the binomial coefficient first and then dividing by n + 1. Because the binomial coefficient is always divisible by n + 1, the result is always an exact integer.

To see the formula in action, work through C(5). The binomial coefficient C(10, 5) equals 252. Divide 252 by n + 1, which is 6, and the result is 42. The same pattern holds for larger values. C(10) equals 16,796, from C(20, 10) = 184,756 divided by 11. C(19) equals 1,767,263,190, from C(38, 19) = 35,345,263,800 divided by 20. Each division produces a whole number with no remainder.

The same formula can also be written as a recurrence that builds each value from the last. The recurrence is C(n+1) = C(n) × 2(2n + 1) / (n + 2). This form uses exact integer arithmetic at every step, so there is no rounding or floating-point error. Starting from C(0) = 1, the recurrence generates the full sequence one term at a time, which is how many implementations of a Catalan number calculator handle computation internally.

The sequence is named after Eugène Charles Catalan, who studied the bracketing problem in 1838. Euler had met the same numbers earlier in the polygon triangulation problem. The reason one formula generates so many terms is that the same number counts many structures at once. The Catalan number C(n) counts the ways to bracket a product of n + 1 factors, the binary trees with n internal nodes, the triangulations of a polygon with n + 2 sides, and the lattice paths from (0,0) to (n,n) that never rise above the diagonal, known as Dyck paths.

Worked examples

The Catalan number calculator applies the formula C(n) = C(2n, n) / (n + 1), where C(2n, n) is a standard binomial coefficient. Because the binomial coefficient is always divisible by n + 1, the result is an exact integer for every non-negative input. The three examples below show the arithmetic in full, step by step, so you can verify the output by hand or compare it against another tool.

Each row in the table pairs the binomial coefficient with its divisor, making the division transparent. The values come from sequence A000108 in the OEIS: 1, 1, 2, 5, 14, 42, 132, 429, and so on. The same number counts many structures at once: the ways to bracket a product of n + 1 factors, the binary trees with n internal nodes, the triangulations of a polygon with n + 2 sides, and the lattice paths from (0,0) to (n,n) that never rise above the diagonal (Dyck paths). So when the calculator returns 42 for n = 5, that single value describes all of those structures simultaneously.

For larger inputs the binomial coefficients grow quickly, but the division by n + 1 keeps the final result manageable. The recurrence C(n+1) = C(n) × 2(2n + 1) / (n + 2) builds each value from the last with exact integer arithmetic at every step, which is how a reliable Catalan number calculator can produce results like C(19) = 1,767,263,190 without rounding or floating-point error. The sequence is named after Eugène Charles Catalan, who studied the bracketing problem in 1838, though Euler had met the same numbers earlier in the polygon triangulation problem.

nBinomial coefficient C(2n, n)Divisor (n + 1)Catalan number C(n)
5252642
10184,7561116,796
1935,345,263,800201,767,263,190

What Catalan numbers count

A Catalan number calculator is more than a tool for producing digits — it opens a window onto one of the richest coincidences in combinatorics. The Catalan numbers, defined by C(n) = C(2n, n) / (n + 1), form sequence A000108 in the OEIS: 1, 1, 2, 5, 14, 42, 132, 429, and so on. What makes them remarkable is that the same number counts many structures at once: the ways to bracket a product of n + 1 factors, the binary trees with n internal nodes, the triangulations of a polygon with n + 2 sides, and the lattice paths from (0,0) to (n,n) that never rise above the diagonal, known as Dyck paths. Non-crossing partitions belong to the same family as well.

Take bracketing first. For three factors a, b, c there are two ways to insert parentheses — ((a × b) × c) and (a × (b × c)) — and that matches C(2) = 2. Jump to n = 5 and the count reaches 42, verified directly from the binomial coefficient C(10, 5) = 252 divided by 6. The same value 42 gives the number of full binary trees with five internal nodes, the number of triangulations of a seven-sided polygon, and the number of Dyck paths from (0,0) to (5,5) staying on or below the diagonal. Eugène Charles Catalan studied the bracketing problem in 1838, though Euler had met the same numbers earlier through polygon triangulation.

The deeper values follow the same pattern. At n = 10 the calculator returns 16,796, obtained from C(20, 10) = 184,756 divided by 11. That single result simultaneously counts the binary trees with ten internal nodes, the triangulations of a twelve-sided polygon, and the Dyck paths reaching (10,10) without crossing above the diagonal. At n = 19 the figure is 1,767,263,190, from C(38, 19) = 35,345,263,800 divided by 20 — a count that applies equally to all of these interpretations.

Each value can be built from the previous one without ever leaving integer arithmetic. The recurrence C(n+1) = C(n) × 2(2n + 1) / (n + 2) generates the sequence step by step, so a Catalan number calculator can start from C(0) = 1 and march forward as far as needed, with exact results at every stage.

  • C(2) = 2: two bracketings of three factors, two binary trees with two internal nodes, two triangulations of a quadrilateral, two Dyck paths to (2,2).
  • C(5) = 42: from C(10, 5) = 252 divided by 6 — bracketings of six factors, binary trees with five internal nodes, triangulations of a heptagon, Dyck paths to (5,5).
  • C(10) = 16,796: from C(20, 10) = 184,756 divided by 11 — bracketings of eleven factors, binary trees with ten internal nodes, triangulations of a dodecagon, Dyck paths to (10,10).
  • C(19) = 1,767,263,190: from C(38, 19) = 35,345,263,800 divided by 20 — the same count across all four interpretations.
One number, many shapes. Whether you are counting parentheses, tree branches, polygon slices, or lattice paths, the Catalan numbers give the same answer — which is why a single calculator serves so many different problems.

How fast they grow

Catalan numbers grow at a remarkable rate. For large n, the value of C(n) behaves roughly like 4^n divided by (n^1.5 × √π). That means each step in the sequence multiplies the previous value by something close to 4, so the numbers balloon quickly. The first few terms look modest — 1, 1, 2, 5, 14, 42, 132, 429 — but by C(10) the value is already 16,796, and by C(19) it reaches 1,767,263,190. A Catalan number calculator that relies on floating-point arithmetic will lose precision well before values get this large, because standard decimal types simply cannot represent every digit of an integer past a billion.

This is why exact integer arithmetic matters. The recurrence C(n+1) = C(n) × 2(2n + 1) / (n + 2) builds each value from the last, and when every step is carried out with exact integers, no digits are dropped or rounded along the way. The formula C(n) = C(2n, n) / (n + 1) gives the same result through the binomial coefficient, but the recurrence is often more practical for computation because it avoids constructing enormous intermediate factorials. Either way, the key is that the division always comes out even — the result is always a whole number — so an exact arithmetic engine can track every digit without loss.

The speed of this growth is part of what makes the Catalan numbers so striking. C(19) equals 1,767,263,190, obtained from C(38, 19) = 35,345,263,800 divided by 20. That single value already exceeds what many calculators can store as an exact integer. Past that point, the numbers continue to climb, doubling in digit count roughly every five steps. A reliable Catalan number calculator needs to handle this scale without converting to scientific notation or truncating trailing digits, because even small rounding errors compound rapidly across a recurrence.

The practical takeaway is simple: once Catalan numbers pass a billion, floating-point methods are no longer trustworthy. Exact integer arithmetic keeps every digit intact, whether the calculator uses the closed-form binomial expression or the step-by-step recurrence. For anyone working with sequence A000108 in the OEIS, that distinction is what separates a tool that gives the right answer from one that quietly drifts off course.

A short history

The sequence now familiar to users of any Catalan number calculator did not begin with the man whose name it carries. Long before Eugène Charles Catalan studied the bracketing problem in 1838, Leonhard Euler had already met these same numbers while working on the polygon triangulation problem. Euler's investigation into how many ways a polygon can be divided into triangles produced the very same values that would later become known as the Catalan numbers, showing that the mathematical structure was recognized across different contexts by different thinkers.

Even earlier, the numbers appeared in Chinese mathematical work. Minggatu, a Qing dynasty mathematician, described the sequence well before either Euler or Catalan. His contributions were not widely known in Europe at the time, but modern scholarship has confirmed that he independently identified the same numerical pattern. This makes the Catalan numbers a rare example of a mathematical concept discovered independently in separate cultural traditions, each approaching the sequence from a different practical problem.

Catalan's own contribution came through his 1838 study of how to parenthesize a product of factors. The question of how many distinct ways one can bracket a sequence of multiplications led him directly to the sequence: 1, 1, 2, 5, 14, 42, 132, 429, and so on. The same numbers that Euler found in polygon triangulations and Minggatu found in his work also answered the bracketing question, a coincidence that reflects the deep combinatorial unity behind the sequence. Today the sequence is cataloged as A000108 in the OEIS.

The lasting significance of these numbers lies in how a single formula, C(n) = C(2n, n) / (n + 1), generates values that count many seemingly unrelated structures at once. The same number counts the ways to bracket a product of n + 1 factors, the binary trees with n internal nodes, the triangulations of a polygon with n + 2 sides, and the lattice paths from (0,0) to (n,n) that never rise above the diagonal. The naming of the sequence after Catalan reflects the common practice of attaching a mathematician's name to a result, even when the history of discovery is richer and more layered than a single name suggests.

FAQs

How do you calculate the Catalan numbers?

Catalan numbers use the formula C(n) = C(2n, n) / (n + 1). For n = 5, that is 252 / 6 = 42. This binomial coefficient divided by n plus 1 gives the exact integer for any nonnegative n, making it straightforward to compute step by step.

What is the 5th Catalan number?

The 5th Catalan number is 42. It also represents the number of ways to fully bracket a product of 6 factors, and to triangulate a seven-sided polygon. This makes 42 a useful example for showing how one sequence describes several distinct combinatorial structures.

What do Catalan numbers count?

Bracketing, binary trees, polygon triangulations and Dyck paths are all counted by the same sequence. For example, C(10) = 16,796 of each. This shared counting property makes Catalan numbers a central object in combinatorics, linking seemingly unrelated structures through a single formula.

How fast do Catalan numbers grow?

They grow roughly like 4^n / (n^1.5 × √π), increasing rapidly with n. By n = 19 the count is already 1,767,263,190. This fast growth means even modest values of n produce very large results, so exact integer arithmetic is essential for accurate computation.

Is there a recurrence for Catalan numbers?

Each value is computed from the previous by C(n+1) = C(n) × 2(2n+1)/(n+2), keeping every intermediate an exact integer. This recurrence lets you build the sequence step by step from C(0) = 1 without computing large binomial coefficients directly, which is efficient and precise.

Who are the Catalan numbers named after?

After Eugène Charles Catalan (1838), though Euler found the same sequence earlier through polygon triangulations. Catalan's independent work on the sequence, particularly its connection to bracketing problems, led to the naming, but Euler's earlier discovery shows the sequence's deep roots in classical mathematics.

Sources

Related calculators

Fibonacci Calculator
The nth Fibonacci number, computed exactly with arbitrary-precision arithmetic — plus the next term, the sum of the first n terms, and how close the ratio has come to the golden ratio.
Factorial Calculator
Exact factorials up to 170! computed with arbitrary-precision integers — no scientific-notation rounding — with the digit count and trailing zeros (Legendre's formula) explained.
Permutation and Combination Calculator
nPr and nCr with and without repetition — permutations where order matters, combinations where it does not — with all four counts side by side.
Multinomial Coefficient Calculator
How many ways N items split into groups of given sizes: N! divided by the product of the group factorials.