User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
Generate C0 through C10 (range: 0โ€“500)
Configure parameters above and press Generate
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

About

Catalan numbers form a sequence of natural integers that appear across discrete mathematics: counting valid parenthesizations, binary tree structures, polygon triangulations, lattice paths below the diagonal, and non-crossing partition counts. The n-th Catalan number Cn grows asymptotically as 4nn3/2 โˆšฯ€, which means manual computation becomes impractical past C20. Incorrect sequence values propagate errors in algorithm analysis, dynamic programming table sizing, and combinatorial proof verification. This generator computes exact arbitrary-precision Catalan numbers using BigInt arithmetic through the iterative recurrence Cn = Cnโˆ’1 ร— 2(2n โˆ’ 1) รท (n + 1), avoiding factorial overflow entirely.

The tool supports indices from 0 to 500. Note: C500 has 299 decimal digits. Results are exact, not floating-point approximations. For research use, be aware that OEIS designates this as sequence A000108.

catalan numbers number sequence combinatorics math generator integer sequence binomial coefficient bigint calculator

Formulas

The n-th Catalan number is defined by the closed-form binomial expression:

Cn = 1n + 1 โ‹… (2n)!n! โ‹… n!

This tool avoids computing large factorials directly. Instead, it uses the iterative recurrence relation which is numerically stable with integer arithmetic:

C0 = 1 , Cn = Cnโˆ’1 โ‹… 2(2n โˆ’ 1)n + 1

The asymptotic growth approximation for large n is given by:

Cn โˆผ 4nn3/2 โˆšฯ€

The generating function for the sequence satisfies the quadratic equation:

C(x) = 1 โˆ’ โˆš1 โˆ’ 4x2x

Where Cn = the n-th Catalan number (dimensionless integer), n = non-negative index (n โˆˆ N0), and n! = factorial of n.

Reference Data

nCnDigit CountCombinatorial Interpretation
011Empty structure (base case)
111Single valid pair of parentheses: ()
221Binary trees with 2 nodes
351Triangulations of a pentagon
4142Non-crossing partitions of {1,2,3,4}
5422Dyck paths of length 10
61323Full binary trees with 7 leaves
74293Stack-sortable permutations of length 7
81,4304Monotone lattice paths in 8ร—8 grid
94,8624Ways to connect 2ร—9 points on circle without crossings
1016,7965Valid sequences of 10 pairs of parentheses
159,694,8457Polygon triangulations of 17-gon
206,564,120,42010Exceeds 32-bit integer range
254,861,946,401,45213Ballot problem configurations
305,909,761,445,129,385,60019Exceeds 64-bit float precision
501.978 ร— 102829RNA secondary structure folds
1008.969 ร— 105859Planar graph enumeration
2002.232 ร— 10118119Requires arbitrary-precision arithmetic
5005.395 ร— 10298299Maximum index supported by this tool

Frequently Asked Questions

JavaScript's Number type uses IEEE 754 double-precision floating point, which provides exact integer representation only up to 2โตยณ โˆ’ 1 (approximately 9 ร— 10ยนโต). The Catalan number Cโ‚ƒโ‚€ = 5,909,761,445,129,385,600 already approaches this boundary. By Cโ‚ƒโ‚…, standard arithmetic produces rounding errors. BigInt provides arbitrary-precision integer arithmetic, ensuring every digit of Cโ‚…โ‚€โ‚€ (a 299-digit number) is exact.
The direct formula C(n) = (2n)! / ((n+1)! ร— n!) requires computing factorials that grow super-exponentially. For n = 100, (200)! has 375 digits. The recurrence C(n) = C(nโˆ’1) ร— 2(2nโˆ’1) / (n+1) multiplies and divides by small values at each step, keeping intermediate results close in magnitude to the final answer. The division is always exact because of the algebraic structure of Catalan numbers - 2(2nโˆ’1) is always divisible by (n+1) when applied to C(nโˆ’1).
C(n) counts at least 66 distinct combinatorial objects (Richard Stanley's catalog). Key examples: valid arrangements of n pairs of parentheses, full binary trees with n+1 leaves, monotone lattice paths from (0,0) to (n,n) that never cross the diagonal, triangulations of an (n+2)-gon, non-crossing partitions of an n-element set, and 321-avoiding permutations of length n. The OEIS entry A000108 provides the comprehensive list.
C(n) is odd if and only if n = 2แต โˆ’ 1 for some non-negative integer k (i.e., n = 0, 1, 3, 7, 15, 31, 63, โ€ฆ). For all other indices, C(n) is even. This result follows from Kummer's theorem applied to the central binomial coefficient. Additionally, C(p) โ‰ก 2 (mod p) for any prime p, which connects Catalan numbers to modular arithmetic and Wolstenholme's theorem.
The approximation C(n) ~ 4โฟ / (n^(3/2) ร— โˆšฯ€) converges slowly. At n = 10, the relative error is approximately 4.5%. At n = 100, it drops to about 0.4%. At n = 500, the error is roughly 0.08%. For precise computation, always use the exact recurrence. The asymptotic form is useful for estimating digit counts and growth rates, not for obtaining actual values.
Yes. For C(n) mod p, use Lucas' theorem combined with modular inverse. Compute the binomial coefficient C(2n, n) mod p using iterative multiplication with Fermat's little theorem for division (since p is prime, aโปยน โ‰ก a^(pโˆ’2) mod p). Then divide by (n+1) mod p. This tool computes exact BigInt values; for modular results, take the output mod your desired prime.