scripts/ege/25013092/16.py
2023-05-05 00:45:01 +03:00

10 lines
162 B
Python

def f(n):
if n < 3:
return 1
if n % 2 == 0:
return 2 * f(n - 1) - f(n - 2)
return f(n - 1) - 2 * f(n - 2) - 3
print(f(15))