Doing Math With JavaScript

Catalan Numbers Calculator
With Arbitrary Precision Arithmetic

  Doing Math with JavaScript  
Input n (up to 25000):  Result: the Catalan number C(n)   (to select: click, Ctrl+A, Ctrl+C) Run time:
n =
 
n =
 
n =
 
n =
 
n =
 

The Catalan numbers C(n) can be defined in several equivalent ways. A formal definition is:

C(n) = (2n)!/(n!(n+1)!).

Another definition: C(n) is the number of ways to insert n pairs of parentheses in an expression with n+1 terms. For example, if n = 2 there are two ways: ((ab)c) or (a(bc)); if n = 3 there are 5 ways: ((ab)(cd)), (((ab)c)d), ((a(bc))d), (a((bc)d)), (a(b(cd))). Accordingly, C(2) = 2 and C(3) = 5.

The Catalan sequence is OEIS A000108; in the Online Encyclopedia of Integer Sequences you can find lots of additional information and further references on Catalan numbers.

This online calculator computes the Catalan numbers C(n) for input values 0 ≤ n ≤ 25000 in arbitrary precision arithmetic. So, for example, you will get all 598 digits of C(1000) – a very large number!

See also:
• 100+ digit calculator: arbitrary precision arithmetic
• Prime factorization calculator
• Binomial coefficients calculator
• Fibonacci numbers calculator
• Euler's totient function φ calculator
• Highly composite numbers
• Divisors and sum-of-divisors calculator

Doing Math with JavaScript. Copyright © 1999-2015, JavaScripter.net.