mirror of
https://github.com/Alexander-D-Karpov/scripts.git
synced 2024-11-25 13:03:44 +03:00
14 lines
287 B
Python
14 lines
287 B
Python
|
def f(n, path):
|
||
|
if n >= 214:
|
||
|
if n == 214:
|
||
|
if [x % 2 for x in path].count(1) <= 7:
|
||
|
return 1
|
||
|
return 0
|
||
|
|
||
|
return (
|
||
|
f(n + 2, path + [n + 2]) + f(n * 2, path + [n * 2]) + f(n * 3, path + [n * 3])
|
||
|
)
|
||
|
|
||
|
|
||
|
print(f(1, [1]))
|