zhukov000

16

Jun 24th, 2021
602
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def f(n):
  2.   if n <= 1:
  3.     return 0
  4.   if n > 1 and n % 2 != 0:
  5.     return f(n-1) + 3 * n ** 2
  6.   if n > 1 and n % 2 == 0:
  7.     return n // 2 + f(n-1) + 2
  8.  
  9. print( f(49) )
  10.  
RAW Paste Data