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.

A151899 Period 6: repeat [0, 0, 1, 1, 1, 2].

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jul 31 2009

Keywords

Crossrefs

Programs

  • Magma
    [Abs( ((1-n) mod 3) - ((1+n) mod 2) ) : n in [0..100]]; // Wesley Ivan Hurt, Aug 20 2014
    
  • Maple
    f := proc(n) local j; j:=n mod 6; if (j<=1) then 0 elif (j<=4) then 1 else 2; fi; end;
    A151899:=n->[0, 0, 1, 1, 1, 2][(n mod 6)+1]: seq(A151899(n), n=0..100); # Wesley Ivan Hurt, Jun 20 2016
  • Mathematica
    Table[Abs[Mod[-n + 1, 3] - Mod[n + 1, 2]], {n, 0, 100}] (* Wesley Ivan Hurt, Aug 20 2014 *)
    CoefficientList[Series[(x^2 + x^3 + x^4 + 2 x^5)/(1 - x^6), {x, 0, 100}], x] (* Wesley Ivan Hurt, Aug 20 2014 *)
    LinearRecurrence[{0, 0, 0, 0, 0, 1},{0, 0, 1, 1, 1, 2},105] (* Ray Chandler, Aug 26 2015 *)
  • PARI
    a(n)=[0,0,1,1,1,2][n%6+1]; \\ Joerg Arndt, Aug 25 2014

Formula

a(n) = 5/6 - cos(Pi*n/3)/3 - sin(Pi*n/3)/sqrt(3) - cos(2*Pi*n/3)/3 - sin(2*Pi*n/3)/sqrt(3) - (-1)^n/6. - R. J. Mathar, Oct 08 2011
G.f.: (x^2+x^3+x^4+2*x^5)/(1-x^6); a(n) = abs( mod(1-n,3) - mod(1+n,2) ). - Wesley Ivan Hurt, Aug 20 2014
a(n) = a(n-6) for n>5. - Wesley Ivan Hurt, Jun 20 2016