dxnge

task 9

Sep 23rd, 2021
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.14 KB | None | 0 0
  1. S = []
  2.  
  3.  
  4. def f(a, b):
  5.     if b > 4:
  6.         return 1
  7.     S.append(a)
  8.     return f(a+1, b+1) + f(a*2, b+1)
  9.  
  10.  
  11. f(1, 0)
  12. print(set(sorted(S)))
Advertisement
Add Comment
Please, Sign In to add comment