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