A229047 Replace all '11' => '101' in the binary representation of n, treat the result as representation of a(n) in base of Fibonacci numbers (A014417).
0, 1, 2, 4, 3, 4, 7, 12, 5, 6, 7, 12, 11, 12, 20, 33, 8, 9, 10, 17, 11, 12, 20, 33, 18, 19, 20, 33, 32, 33, 54, 88, 13, 14, 15, 25, 16, 17, 28, 46, 18, 19, 20, 33, 32, 33, 54, 88, 29, 30, 31, 51, 32, 33, 54, 88, 52, 53, 54, 88, 87, 88, 143, 232, 21, 22, 23, 38, 24, 25, 41
Offset: 0
Examples
Base 2 representation of 14 is 1110, that is 101010 after the replacement, that is A014417(20), so a(14)=20.
Programs
-
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=', ')
Comments