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.

A086694 A run of 2^n 1's followed by a run of 2^n 0's, for n=0, 1, 2, ...

Original entry on oeis.org

1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Ralf Stephan, Sep 12 2003

Keywords

Comments

First differences of A006165 and, likely, of A078881.

Crossrefs

Programs

  • Maple
    seq(op([1$(2^n),0$(2^n)]),n=0..6); # Robert Israel, Jul 27 2017
  • Mathematica
    Table[{PadRight[{},2^n,1],PadRight[{},2^n,0]},{n,0,5}]//Flatten (* Harvey P. Dale, May 29 2017 *)
    Table[{Array[1&,2^n],Array[0&,2^n]},{n,0,5}]//Flatten (* Wolfgang Hintze, Jul 27 2017 *)
  • PARI
    a(n)=if(n<3,if(n<2,1,0),if(n%2==0,a(n/2-1),a((n-1)/2)))

Formula

a(n) = 1-A079944(n-1) = 2-A079882(n-1) = A080791(n+1)-A083661(n+1).
a(n) = 1 - floor(log_2(4*(n+1)/3)) + floor(log_2(n+1)).
a(1) = 1, a(2) = 0, a(2n+1) = a(n), a(2n) = a(n-1).
G.f.: Sum_{k>=1} (x^(2^k)-x^(3*2^(k-1)))/(x-x^2). - Robert Israel, Jul 27 2017
G.f.: g(x) = (1/(1 - x))*( Sum_{n >= 1} x^(2^n-1)*(1 - x^2^(n-1)) ). Functional equation: g(x) = x + x*(1+x)*g(x^2). - Wolfgang Hintze, Aug 05 2017