Created
January 16, 2015 23:38
-
-
Save juanplopes/aabf64c52d87d3adc933 to your computer and use it in GitHub Desktop.
This file contains 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
import math | |
def f(i, n): | |
if i==0: return 0 | |
if i==1: return n/2 | |
if i%2==0: | |
return f(i/2, n)-f(int(math.log(i)/math.log(2)), n)/2 | |
else: | |
return f(i/2, n)+f(int(math.log(i)/math.log(2)), n)/2 | |
print len(set(f(x, 360) for x in range(360))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment