Skip to content

Instantly share code, notes, and snippets.

@Scinawa
Created March 25, 2016 22:56
Show Gist options
  • Save Scinawa/75d9c683078b05fa1e1a to your computer and use it in GitHub Desktop.
Save Scinawa/75d9c683078b05fa1e1a to your computer and use it in GitHub Desktop.
stirling number of the second kind
def stirling_second(x,n):
if n <= 1 or x == n: return 1
if n > x or x <= 0: return 0
return stirling_second(x-1, n-1) + n * stirling_second(x-1, n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment