mirror of
https://github.com/Alexander-D-Karpov/scripts.git
synced 2024-11-15 01:16:36 +03:00
17 lines
204 B
Python
17 lines
204 B
Python
|
def f(n):
|
||
|
if n == 0:
|
||
|
return 0
|
||
|
if n % 2 == 0:
|
||
|
return f(n / 2) - 1
|
||
|
return f(n - 1) + 2
|
||
|
|
||
|
|
||
|
c = 0
|
||
|
|
||
|
for i in range(1000):
|
||
|
if f(i) == 3:
|
||
|
c += 1
|
||
|
|
||
|
|
||
|
print(c)
|