Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(a, b, m):
- if a + b >= 59:
- return m % 2 == 0
- if m == 0:
- return 0
- h = [f(a + 1, b, m), f(a * 2, b, m), f(a, b + 1, m), f(a, b * 2, m)]
- return any(h) if (m - 1) % 2 == 0 else (h)
- print([s for s in range(2, 53) if f(5, s, 1)])
- print([s for s in range(2, 53) if not f(5, s, 1) and f(5, s, 3)])
- print([s for s in range(2, 53) if f(5, s, 4) and not f(5, s, 2)])
Advertisement
Add Comment
Please, Sign In to add comment