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.

A079946 Numbers k whose binary expansion begins with two or more 1's and ends with at least one 0.

Original entry on oeis.org

6, 12, 14, 24, 26, 28, 30, 48, 50, 52, 54, 56, 58, 60, 62, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246
Offset: 1

Views

Author

N. J. A. Sloane, Feb 21 2003

Keywords

Comments

a(n) = b(n+1), with b(2n) = 2b(n), b(2n+1) = 2b(n)+2+4[n==0]. - Ralf Stephan, Oct 11 2003

Crossrefs

A004755 = union of this and A080565. A057547(n) = a(A014486(n)) for n >= 1.

Programs

  • Maple
    A079946 := n -> 2*(2^(1+A000523(n))+n);
  • Mathematica
    Table[Union[FromDigits[Join[{1,1},#,{0}],2]&/@Tuples[{1,0},n]],{n,0,5}]//Flatten (* Harvey P. Dale, Jan 16 2018 *)
  • PARI
    for(n=0,6, for(k=2^(n-1),2^n-1,print1((2^n+k)*2,",")))
    
  • PARI
    for(n=1,59,print1((2^(floor(log(n)/log(2))+1)+n)*2,","))
    
  • PARI
    a(n) = n*2 + 4<Ruud H.G. van Tol, May 10 2024
    
  • Python
    def A079946(n): return n+(1<Chai Wah Wu, Jul 13 2022

Formula

a(n) = 2^floor(log_2(4*n))+2*n. - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Feb 22 2003
a(n) = (2^(floor(log_2(n))+1)+n)*2. - Klaus Brockhaus, Feb 23 2003
a(2n) = 2a(n), a(2n+1) = 2a(n) + 2 + 4[n==0]. Twice A004755. - Ralf Stephan, Oct 12 2003

Extensions

Definition clarified by N. J. A. Sloane, May 10 2024