WOLFRAM

gives the n^(th) Catalan number TemplateBox[{n}, CatalanNumber].

Details

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

The first 10 Catalan numbers:

Out[1]=1

Scope  (9)Survey of the scope of standard use cases

Evaluate for large arguments:

Evaluate for half-integer arguments:

Out[1]=1

Evaluate numerically:

Out[1]=1

Evaluate for complex arguments:

Out[1]=1

Plot the Catalan number as a function of its index:

Out[1]=1

Compute sums involving CatalanNumber:

Out[1]=1
Out[2]=2

CatalanNumber threads element-wise over lists:

Out[1]=1

CatalanNumber can be used with Interval and CenteredInterval objects:

Out[1]=1
Out[2]=2

TraditionalForm typesetting:

Applications  (3)Sample problems that can be solved with this function

Compute the number of different ways to parenthesize an expression:

Distribute over lists in CirclePlus:

Use the pattern matcher to repeatedly split the list into two parts in all possible ways:

Out[3]=3

The number of ways to parenthesize the expression abcd:

Out[4]=4

Check:

Out[5]=5

The Catalan numbers CatalanNumber[n] can be characterized as the unique set of numbers such that two Hankel determinants are both equal to one. Verify for the first few cases:

Out[1]=1

Verify an expression for the Catalan numbers in terms of double factorials:

Out[1]=1

Properties & Relations  (6)Properties of the function, and connections to other functions

The generating function for Catalan numbers:

Out[1]=1
Out[2]=2
Out[3]=3

Catalan numbers can be represented as a difference of binomial coefficients:

Out[1]=1
Out[2]=2
Out[3]=3

Catalan numbers can be represented in terms of the generalized Bell polynomial:

Out[1]=1
Out[2]=2

CatalanNumber can be represented as a DifferenceRoot:

Out[1]=1

FindSequenceFunction can recognize the CatalanNumber sequence:

Out[1]=1
Out[2]=2

The exponential generating function for CatalanNumber:

Out[1]=1

Possible Issues  (1)Common pitfalls and unexpected behavior

The Catalan number TemplateBox[{{-, 1}}, CatalanNumber] is, by convention, defined using its representation in terms of binomials:

Out[5]=5

This value is different from the limiting value of the analytic function:

Out[2]=2
Out[3]=3

Neat Examples  (2)Surprising or curious use cases

The only odd Catalan numbers are those of the form CatalanNumber[2k-1]:

Out[1]=1

Determinants of Hankel matrices made out of sums of Catalan numbers:

Out[1]=1

Compare with an expression in terms of the Fibonacci numbers:

Out[2]=2
Wolfram Research (2007), CatalanNumber, Wolfram Language function, https://reference.wolfram.com/language/ref/CatalanNumber.html (updated 2014).
Wolfram Research (2007), CatalanNumber, Wolfram Language function, https://reference.wolfram.com/language/ref/CatalanNumber.html (updated 2014).

Text

Wolfram Research (2007), CatalanNumber, Wolfram Language function, https://reference.wolfram.com/language/ref/CatalanNumber.html (updated 2014).

Wolfram Research (2007), CatalanNumber, Wolfram Language function, https://reference.wolfram.com/language/ref/CatalanNumber.html (updated 2014).

CMS

Wolfram Language. 2007. "CatalanNumber." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/CatalanNumber.html.

Wolfram Language. 2007. "CatalanNumber." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/CatalanNumber.html.

APA

Wolfram Language. (2007). CatalanNumber. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CatalanNumber.html

Wolfram Language. (2007). CatalanNumber. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CatalanNumber.html

BibTeX

@misc{reference.wolfram_2025_catalannumber, author="Wolfram Research", title="{CatalanNumber}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/CatalanNumber.html}", note=[Accessed: 29-April-2025 ]}

@misc{reference.wolfram_2025_catalannumber, author="Wolfram Research", title="{CatalanNumber}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/CatalanNumber.html}", note=[Accessed: 29-April-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_catalannumber, organization={Wolfram Research}, title={CatalanNumber}, year={2014}, url={https://reference.wolfram.com/language/ref/CatalanNumber.html}, note=[Accessed: 29-April-2025 ]}

@online{reference.wolfram_2025_catalannumber, organization={Wolfram Research}, title={CatalanNumber}, year={2014}, url={https://reference.wolfram.com/language/ref/CatalanNumber.html}, note=[Accessed: 29-April-2025 ]}