Skip to content

Instantly share code, notes, and snippets.

@christabor
Last active August 29, 2015 14:24
Show Gist options
  • Save christabor/8eabd20957bfecfb77fd to your computer and use it in GitHub Desktop.
Save christabor/8eabd20957bfecfb77fd to your computer and use it in GitHub Desktop.
Catalan numbers
# 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