Farz0l1x

Untitled

Feb 24th, 2023
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. def f(curr, end):
  2.     if curr > end:
  3.         return 0
  4.     if curr == end:
  5.         return 1
  6.     if curr < end:
  7.         return f(curr + 2, end) + f(curr + 4, end) + f(curr + 5, end)
  8. for i in range(31, 1000):
  9.     if f(31, i) == 1001:
  10.         print(i)
Advertisement
Add Comment
Please, Sign In to add comment