Farz0l1x

Untitled

Nov 11th, 2023
658
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. def f(a, b, m):
  2.     if a + b >= 59:
  3.         return m % 2 == 0
  4.     if m == 0:
  5.         return 0
  6.     h = [f(a + 1, b, m), f(a * 2, b, m), f(a, b + 1, m), f(a, b * 2, m)]
  7.     return any(h) if (m - 1) % 2 == 0 else (h)
  8. print([s for s in range(2, 53) if f(5, s, 1)])
  9. print([s for s in range(2, 53) if not f(5, s, 1) and f(5, s, 3)])
  10. 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