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