Last active
August 29, 2015 14:24
-
-
Save christabor/8eabd20957bfecfb77fd to your computer and use it in GitHub Desktop.
Catalan numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://en.wikipedia.org/wiki/Catalan_number | |
import math | |
prod = 1 | |
for n in range(2, 100): | |
prod = math.factorial((2 * n)) // ( | |
math.factorial((n + 1)) * math.factorial(n)) | |
print(prod) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment