Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(n, cnt):
- if cnt < 900:
- if n <= 5:
- return n
- if n % 3 == 0:
- return n + f(n//3+1, cnt + 1)
- else:
- return n + f(n+3, cnt + 1)
- else:
- return 0
- for i in range(0, 10000):
- if f(i, 0) > 1000:
- print(i)
- break
Advertisement
Add Comment
Please, Sign In to add comment