Advertisement
Farz0l1x

Untitled

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