Farz0l1x

Untitled

Nov 25th, 2023
747
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. def f(a, m):
  2.     if a >= 30:
  3.         return m % 2 == 0
  4.     if m == 0:
  5.         return 0
  6.     h = [f(a+1, m-1), f(a*2, m-1)]
  7.     return any(h) if (m-1) % 2 == 0 else all(h)
  8. print([s for s in range(1, 30) if f(s, 4)])
Advertisement
Add Comment
Please, Sign In to add comment