Skip to content

Instantly share code, notes, and snippets.

@cls cls/catalan.py
Created Feb 20, 2017

Embed
What would you like to do?
Calculating the Catalan number series
from fractions import Fraction
def catalan(n):
c = 1
for k in range(2, n + 1):
c *= Fraction(n + k, k)
return int(c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.