OFFSET
0,3
COMMENTS
Index of r in A014417, where r = ReplaceAll('11' -> '101' in bin(n)).
EXAMPLE
Base 2 representation of 14 is 1110, that is 101010 after the replacement, that is A014417(20), so a(14)=20.
PROG
(Python)
fib = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597]
for n in range(333):
res = 0
bit = resbit = 1
while bit<=n:
if n&bit: res += resbit
resbit*=2
if (n&bit) and (n&(bit*2)): resbit*=2
bit*=2
#print(bin(n), bin(res), end=', ')
an = i = 0
while res:
if res&1: an += fib[2+i]
i += 1
res >>= 1
print(an, end=', ')
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Alex Ratushnyak, Sep 25 2013
STATUS
approved