cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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).

Original entry on oeis.org

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

Views

Author

Alex Ratushnyak, Sep 25 2013

Keywords

Comments

Index of r in A014417, where r = ReplaceAll('11' -> '101' in bin(n)).

Examples

			Base 2 representation of 14 is 1110, that is 101010 after the replacement, that is A014417(20), so a(14)=20.
		

Crossrefs

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=', ')