Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def m(n, k ,p):
- if k > 2:
- return False
- if p:
- if n >= 1000:
- return False
- return any([m(n+100, k+1, not p), m(n*2, k+1, not p)])
- else:
- if n >= 1000 and (k==2):
- return True
- return all([m(n+100, k+1, not p), m(n*2, k+1, not p)])
- c = 0
- for s in range(1, 999 + 1):
- if m(s, 0, False):
- c+=1
- print(c)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement