Skip to content

Instantly share code, notes, and snippets.

@angch
Created March 24, 2016 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angch/898f1686ba88fc122b5c to your computer and use it in GitHub Desktop.
Save angch/898f1686ba88fc122b5c to your computer and use it in GitHub Desktop.
# Yes, I cheated, after getting the formula wrong.
f = [1]
def fac(n):
if n >= len(f):
f.append(fac(n-1) * n)
return f[n]
n = 20
print fac(n*2) / (fac(n)*fac(n))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment