mirror of
https://github.com/Alexander-D-Karpov/scripts.git
synced 2024-11-25 21:13:43 +03:00
10 lines
148 B
Python
Vendored
10 lines
148 B
Python
Vendored
def f(n):
|
|
if n < 3:
|
|
return 1
|
|
if n % 2 == 0:
|
|
return f(n - 1) + n - 1
|
|
return f(n - 2) + 2 * n - 2
|
|
|
|
|
|
print(f(33))
|