← Back to challenges

Catalan Number

PythonHardmathlanguage_fundamentals

Instructions

Create a function that returns the nth catalan number.In combinatorial mathematics, the Catalan numbers form a sequence of natural numbers that occur in various counting problems, often involving recursively-defined objects. They are named after the Belgian mathematician Eugène Charles Catalan (1814–1894). For more info, check out the resource tab.

Examples

get_catalan_number(0) ➞ 1

get_catalan_number(6) ➞ 132

get_catalan_number(8) ➞ 1430

Notes

Inputs are zero and positive integers.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.