Catalan Number Calculator
Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 9/10/2026
The nth Catalan number is calculated by C(n) = (2n)! ÷ ((n+1)! × n!). It counts, among other things, the number of ways to correctly parenthesize an expression with n+1 factors: for n=3, you get C(3)=5, corresponding to the 5 possible valid parenthesizations of 4 factors.
Explanation
Catalan numbers form one of the most famous sequences in discrete mathematics, because they appear — often surprisingly — to count structures that seem at first to have nothing to do with each other: the number of ways to correctly parenthesize a sequence of operations (for example to unambiguously define the order of multiplications in a×b×c×d), the number of distinct binary trees that can be built with a given number of nodes, the number of paths on a grid connecting two opposite corners without ever crossing the diagonal, or the number of ways to cut a convex polygon into triangles using non-crossing diagonals. This phenomenon, where the same numerical formula appears in apparently unrelated combinatorial contexts, is one of the most striking experiences the study of discrete mathematics offers. The sequence grows very quickly: it can also be derived directly from the permutations and combinations calculator already on this site, since C(n) is exactly the central binomial coefficient C(2n,n) divided by (n+1) — a relation that makes it easy to check any value of this sequence from an already-available tool.
Example: the 5 valid parenthesizations of 4 factors
Inputs
n = 3 (corresponds to an expression with n+1 = 4 factors, e.g. a×b×c×d).
Calculation
C(3) = (2×3)! ÷ ((3+1)! × 3!) = 6! ÷ (4! × 3!) = 720 ÷ (24×6) = 720 ÷ 144 = 5.
Result
There are exactly 5 ways to place parentheses to group 4 factors pairwise: ((ab)c)d, (a(bc))d, (ab)(cd), a((bc)d), a(b(cd)) — each valid and potentially distinct if the operation is not associative.
Frequently asked questions
Why do Catalan numbers appear in so many different contexts?
It is a well-known and studied phenomenon in combinatorics: many structures that look different on the surface (binary trees, parenthesizations, paths under a diagonal) actually share the same underlying "recursive construction rule" — each can be decomposed into two smaller sub-structures of the same type, in exactly the same mathematical way. It is this common recursive structure that produces the same sequence of numbers, whatever the concrete guise of the problem.
How do you calculate Catalan numbers without going through factorials?
There is an equivalent recurrence formula, often more practical for manual or computer calculation on large values: C(n+1) = C(n) × 2(2n+1) ÷ (n+2), with C(0)=1 as the starting point. This formula avoids handling huge factorials that grow much faster than the final result itself, a real numerical advantage beyond the modest values covered by this calculator.
Is there a link between the Catalan number and the binomial coefficient?
Yes, a direct and simple link: C(n) = C(2n,n) ÷ (n+1), where C(2n,n) is the central binomial coefficient (the number of ways to choose n elements from 2n, computable with the permutations and combinations calculator already on this site). This relation shows that Catalan numbers are, at heart, just a "corrected" version of the central binomial coefficient — a role somewhat comparable to that of the combinations with repetition calculator relative to the classic binomial coefficient, each adding its own combinatorial correction to the base formula.