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.

A095130 Expansion of (x+x^2)/(1-x^6); period 6: repeat [0, 1, 1, 0, 0, 0].

Original entry on oeis.org

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

Views

Author

Paul Barry, May 29 2004

Keywords

Comments

Sequences of period k composed of (k-p) zeros followed by p ones have a closed formula of floor((n mod k)/(k-p)), for p>=floor(n/2). [Gary Detlefs, May 18 2011]

Crossrefs

Programs

  • Magma
    [Floor(((n+3) mod 6)/4) : n in [0..100]]; // Wesley Ivan Hurt, Sep 08 2015
    
  • Magma
    &cat[[0,1,1,0,0,0]: n in [0..15]]; // Vincenzo Librandi, Sep 09 2015
  • Maple
    A095130:=n->floor(((n+3) mod 6)/4); seq(A095130(n), n=0..100); # Wesley Ivan Hurt, Feb 24 2014
  • Mathematica
    PadRight[{},120,{0,1,1,0,0,0}] (* or *) LinearRecurrence[{1,-1,1,-1,1},{0,1,1,0,0},120] (* Harvey P. Dale, Nov 18 2013 *)

Formula

G.f.: x/(1-x+x^2-x^3+x^4-x^5);
a(n) = 1/3-cos(2*Pi*n/3)/3+sin(Pi*n/3)/sqrt(3).
a(n) = mod(A095129(n),3).
a(n) = floor(((n+3) mod 6)/4). [Gary Detlefs, May 18 2011]
a(0)=0, a(1)=1, a(2)=1, a(3)=0, a(4)=0, a(n) = a(n-1)-a(n-2)+a(n-3)-a(n-4)+ a(n-5). - Harvey P. Dale, Nov 18 2013
a(n) = floor((n-1)/6) - floor((n-3)/6). - Wesley Ivan Hurt, Sep 08 2015

Extensions

Corrected by T. D. Noe, Nov 08 2006