Advertisement
ForestFox

Untitled

Apr 12th, 2021
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #Problem 7
  2. a = set()
  3. def f(current, step):
  4. if step == 8:
  5. a.add(current)
  6. else:
  7. f(current+1, step+1)
  8. f(current+5, step+1)
  9. f(current*3, step+1)
  10. f(1, 0)
  11. k=0
  12. for i in range(1000, 1024):
  13. if i in a:
  14. k+=1
  15. print(k)
  16. #1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement