Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #https://inf-ege.sdamgia.ru/problem?id=58222
- def f(n):
- if n < 3:
- return 1
- if n % 2 == 1:
- return f(n - 1) + 3 * f(n - 2)
- sm = 0
- for i in range(1, n):
- sm += f(i)
- return sm
- print(f(28))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement