dxnge

37

Dec 6th, 2021
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. def f(n, cnt):
  2.     if cnt < 900:
  3.         if n <= 5:
  4.             return n
  5.         if n % 3 == 0:
  6.             return n + f(n//3+1, cnt + 1)
  7.         else:
  8.             return n + f(n+3, cnt + 1)
  9.     else:
  10.         return 0
  11.  
  12. for i in range(0, 10000):
  13.     if f(i, 0) > 1000:
  14.         print(i)
  15.         break
  16.  
Advertisement
Add Comment
Please, Sign In to add comment