Created
December 9, 2016 16:06
-
-
Save bastianccm/d995833fc1b59b00de13592dc5d85720 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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