Description Usage Arguments Value References Examples
The Catalan numbers are a sequence of natural numbers, typically denoted C_n where n is the n^{th} Catalan number. The solution to Euler's Polygon Division Problem, which is the problem of finding the number of triangles that can be divided from a polygon of n segments, where the number of triangles is E_n, is the Catalan number C_{n-2}. The first few Catalan numbers are 1, 1, 2, 5, 14, 42, 132, 429, ... The function is implemented using the recurrence relation of C_n:
C_{n+1} = \frac{2(2n + 1)}{n + 2} C_n
1 | catalan(n)
|
n |
Specify the length of the returned Catalan number sequence. |
vector of n length
Catalan number. (2018, January 18). In Wikipedia, The Free Encyclopedia. Retrieved 14:03, January 27, 2018, from https://en.wikipedia.org/w/index.php?title=Catalan_number&oldid=821121794 Weisstein, Eric W. "Euler's Polygon Division Problem." From MathWorld–A Wolfram Web Resource. http://mathworld.wolfram.com/EulersPolygonDivisionProblem.html Stanley, Richard and Weisstein, Eric W. "Catalan Number." From MathWorld–A Wolfram Web Resource. http://mathworld.wolfram.com/CatalanNumber.html
1 | catalan(5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.