Catalan Number

DOWNLOAD Mathematica Notebook CatalanPolygons

The Catalan numbers on nonnegative integers n are a set of numbers that arise in tree enumeration problems of the type, "In how many ways can a regular n-gon be divided into n-2 triangles if different orientations are counted separately?" (Euler's polygon division problem). The solution is the Catalan number C_(n-2) (Pólya 1956; Dörrie 1965; Honsberger 1973; Borwein and Bailey 2003, pp. 21-22), as graphically illustrated above (Dickau).

Catalan numbers are commonly denoted C_n (Graham et al. 1994; Stanley 1999b, p. 219; Pemmaraju and Skiena 2003, p. 169; this work) or c(n) (Goulden and Jackson 1983, p. 111), and less commonly u_n (van Lint and Wilson 1992, p. 136).

Catalan numbers are implemented in the Wolfram Language as CatalanNumber[n].

The first few Catalan numbers for n=1, 2, ... are 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, ... (OEIS A000108).

CatalanNumber

Explicit formulas for C_n include

C_n=1/(n+1)(2n; n)
(1)
=((2n)!)/((n+1)!n!)
(2)
=(2^n(2n-1)!!)/((n+1)!)
(3)
=(4^nGamma(n+1/2))/(sqrt(pi)Gamma(n+2))
(4)
=(-1)^n2^(2n+1)(1/2; n+1)
(5)
=1/n(2n; n-1)
(6)
=_2F_1(1-n,-n;2;1),
(7)

where (n; k) is a binomial coefficient, n! is a factorial, n!! is a double factorial, Gamma(z) is the gamma function, and _2F_1(a,b;c;z) is a hypergeometric function.

CatalanNumberReImCatalanNumberContours

The Catalan numbers may be generalized to the complex plane, as illustrated above.

Sums giving C_n include

C_n=sum_(k=0)^(n-1)C_kC_(n-k-1)
(8)
=sum_(k=0)^(n-1)C_k2^(n-2k-1)(n-1; 2k)
(9)
=1/nsum_(k=0)^(n-1)C_(n-k+1)(2k+1; k+1)
(10)
=sum_(k=0)^(n)(-1)^k2^(n-k)(n; k)(k; |_k/2_|)
(11)
=sum_(k=0)^(|_n/2_|)[(n-2k+1)/(n-k+1)(n; n-k)]^2,
(12)

where |_x_| is the floor function, and a product for C_n is given by

 C_n=1/((n+1)!)product_(k=1)^n(4k-2).
(13)

Sums involving C_n include the generating function

2/(1+sqrt(1-4x))=sum_(n=0)^(infty)C_nx^n
(14)
=1+x+2x^2+5x^3+14x^4+...
(15)

(OEIS A000108), exponential generating function

e^(2x)[I_0(2x)-I_1(2x)]=sum_(n=0)^(infty)C_n(x^n)/(n!)
(16)
=1+x+x^2+5/6x^3+7/(12)x^4+7/(20)x^5+...
(17)

(OEIS A144186 and A144187), where I_n(x) is a modified Bessel function of the first kind, as well as

sum_(n=1)^(infty)(C_n)/(4^n)=1
(18)
sum_(n=0)^(infty)(C_nx^(2n))/((2n)!)=(I_1(2x))/x.
(19)

The asymptotic form for the Catalan numbers is

 C_x∼(4^x)/(sqrt(pi))(x^(-3/2)-9/8x^(-5/2)+(145)/(128)x^(-7/2)+...)
(20)

(Vardi 1991, Graham et al. 1994).

The numbers of decimal digits in C_(10^n) for n=0, 1, ... are 1, 5, 57, 598, 6015, 60199, 602051, 6020590, ... (OEIS A114466). The digits converge to the digits in the decimal expansion of log_(10)4=0.602059991... (OEIS A114493).

A recurrence relation for C_n is obtained from

 (C_(n+1))/(C_n)=(2(2n+1))/(n+2),
(21)

so

 C_(n+1)=(2(2n+1))/(n+2)C_n.
(22)

Segner's recurrence formula, given by Segner in 1758, gives the solution to Euler's polygon division problem

 E_n=E_2E_(n-1)+E_3E_(n-2)+...+E_(n-1)E_2.
(23)

With E_1=E_2=1, the above recurrence relation gives the Catalan number C_(n-2)=E_n.

From the definition of the Catalan number, every prime divisor of C_n is less than 2n. On the other hand, C_n>2n-1 for n>4. Therefore, C_3 is the largest Catalan prime, making C_2=2 and C_3=5 the only Catalan primes. (Of course, much more than this can be said about the factorization of C_n.)

The only odd Catalan numbers are those of the form C_(2^k-1). The first few are therefore 1, 5, 429, 9694845, 14544636039226909, ... (OEIS A038003).

The odd Catalan numbers C_n end in 5 unless the base-5 expansion of 2^n-1 uses only the digits 0, 1, 2, so it would be extremely rare for a long sequence of essentially random base-5 digits to contain only in 0, 1, and 2. In fact, the last digits of the odd Catalan numbers are 1, 5, 9, 5, 9, 5, 9, 7, 5, 5, 5, 5, 5, ... (OEIS A094389), so 5 is the last digit for all n up to at least n=10^5 with the exception of 1, 3, 5, 7, and 8.

CatalanTrees

The Catalan numbers turn up in many other related types of problems. The Catalan number C_(n-1) also gives the number of binary bracketings of n letters (Catalan's problem), the solution to the ballot problem, the number of trivalent planted planar trees (Dickau; illustrated above), the number of states possible in an n-flexagon, the number of different diagonals possible in a frieze pattern with n+1 rows, the number of Dyck paths with n strokes, the number of ways of forming an n-fold exponential, the number of rooted planar binary trees with n internal nodes, the number of rooted plane bushes with n graph edges, the number of extended binary trees with n internal nodes, and the number of mountains which can be drawn with n upstrokes and n downstrokes, the number of noncrossing handshakes possible across a round table between n pairs of people (Conway and Guy 1996)!

A generalization of the Catalan numbers is defined by

_pd_k=1/k(pk; k-1)
(24)
=1/((p-1)k+1)(pk; k)
(25)

for k>=1 (Klarner 1970, Hilton and Pedersen 1991). The usual Catalan numbers C_k=_2d_k are a special case with p=2. _pd_k gives the number of p-ary trees with k source-nodes, the number of ways of associating k applications of a given p-ary operator, the number of ways of dividing a convex polygon into k disjoint (p+1)-gons with nonintersecting polygon diagonals, and the number of p-good paths from (0, -1) to (k,(p-1)k-1) (Hilton and Pedersen 1991).

A further generalization is obtained as follows. Let p be an integer >1, let P_k=(k,(p-1)k-1) with k>=0, and q<=p-1. Then define _pd_(q0)=1 and let _pd_(qk) be the number of p-good paths from (1, q-1) to P_k (Hilton and Pedersen 1991). Formulas for _pd_(qi) include the generalized Jonah formula

 (n-q; k-1)=sum_(i=1)^k_pd_(qi)(n-pi; k-i)
(26)

and the explicit formula

 _pd_(qk)=(p-q)/(pk-q)(pk-q; k-1).
(27)

A recurrence relation is given by

 _pd_(qk)=sum_(i,j)_pd_(p-r,i)_pd_(q+r,j)
(28)

where i,j,r>=1, k>=1, q<p-r, and i+j=k+1 (Hilton and Pedersen 1991).

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.