Skip to content

Instantly share code, notes, and snippets.

@bastianccm
Created December 9, 2016 16:06
Show Gist options
  • Save bastianccm/d995833fc1b59b00de13592dc5d85720 to your computer and use it in GitHub Desktop.
Save bastianccm/d995833fc1b59b00de13592dc5d85720 to your computer and use it in GitHub Desktop.
def f(n):
m=n/2
while n%m:m-=1
return set([n])if m==1 else f(m)|f(n/m)
print f(47)
print f(48)
print f(49)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment