dxnge

11

Sep 30th, 2021 (edited)
77
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(n):
  2.     if n <= 1:
  3.         return n
  4.     if n > 1 and n % 2 == 0:
  5.         return 1 + f(n//2)
  6.     if n > 1 and n % 2 != 0:
  7.         return 1 + f(n + 2)
  8.  
  9.  
  10. #print(f(2), f(4), f(32), f(32768))
  11. print(32768)
Advertisement
Add Comment
Please, Sign In to add comment