Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(n):
- if n <= 1:
- return 0
- if n > 1 and n % 2 != 0:
- return f(n-1) + 3 * n ** 2
- if n > 1 and n % 2 == 0:
- return n // 2 + f(n-1) + 2
- print( f(49) )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement