How to use (3 steps)
- Choose n and a representation tab (parentheses, path, or tree).
- Pick enumerate or sample, then set limits and seed as needed.
- Review C_n, examples, and the full table, then export CSV or share the URL.
Inputs
Result
How to read the examples
Parentheses use '(' and ')'. Paths use U for up, R for right. Trees use (L,R) with '*' as a leaf.
Enumeration is automatically disabled for large n. Sampling uses a uniform DP method with a fixed seed.
Examples
Table (C_0 to C_nMax)
| n | C_n | digits |
|---|
Example walkthroughs
n = 3 (5 strings)
Balanced parentheses of length 6: ((())), (()()), (())(), ()(()), ()()().
n = 10 (C_10 = 16796)
Use sampling to browse examples and export a CSV if you need test data.
FAQ
What is a Catalan number?
Catalan numbers count balanced parentheses, Dyck paths, full binary trees, and many other structures that share the same recurrence.
Why is enumeration capped?
The number of examples grows very quickly. Sampling keeps the page responsive while still giving representative outputs.
Is the sampler uniform?
Yes. The sampler uses DP counts to choose each step so every Dyck word is equally likely. A fixed seed reproduces the same list.
How do Dyck paths map to parentheses?
Map '(' to U and ')' to R. The path stays under the diagonal exactly when the parentheses string is balanced.
How does polygon triangulation relate?
The number of triangulations of a convex (n+2)-gon is also C_n, so polygon triangulation is another Catalan structure.
What tree definition is used?
This page uses full binary trees with n internal nodes. Leaves are shown as '*', and internal nodes are written as (L,R).