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.

A084473 Replace 0 with 0000 in binary representation of n.

Original entry on oeis.org

1, 16, 3, 256, 33, 48, 7, 4096, 513, 528, 67, 768, 97, 112, 15, 65536, 8193, 8208, 1027, 8448, 1057, 1072, 135, 12288, 1537, 1552, 195, 1792, 225, 240, 31, 1048576, 131073, 131088, 16387, 131328, 16417, 16432, 2055, 135168, 16897, 16912, 2115, 17152, 2145
Offset: 1

Views

Author

Reinhard Zumkeller, May 27 2003

Keywords

Comments

a(n) = n iff n = 2^k - 1, k>0 (A000225). - Bernard Schott, Dec 18 2021

Crossrefs

Programs

  • Haskell
    a084473 1 = 1
    a084473 x = 2 * (if b == 1 then 1 else 8) * a084473 x' + b
                where (x', b) = divMod x 2
    -- Reinhard Zumkeller, Mar 31 2015
    
  • Maple
    a:= n-> Bits[Join](subs(0=[0$4][], Bits[Split](n))):
    seq(a(n), n=1..49);  # Alois P. Heinz, Jan 15 2021
  • Mathematica
    a[n_] := FromDigits[IntegerDigits[n, 2] /. 0 -> Sequence@@{0,0,0,0}, 2];
    Array[a, 50] (* Jean-François Alcover, Dec 16 2021 *)
  • Python
    def a(n): return int(bin(n)[2:].replace('0', '0000'), 2)
    print([a(n) for n in range(1, 46)]) # Michael S. Branicky, Jan 15 2021

Formula

a(1)=1, a(2*k+1)=2*a(k)+1, a(2*k)=16*a(k).
a(n) = A084471(A084471(n)).
A084474(n) = A007088(a(n));
A023416(a(n)) = A023416(n)*4.
A000120(a(n)) = A000120(n).