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.

A131026 Periodic sequence (2, 2, 1, 0, 0, 1).

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, following a suggestion of Paul Curtz, Jun 10 2007

Keywords

Comments

Second column of triangular array T defined in A131022.

Crossrefs

Cf. A131022, A021823. Other columns of T are in A088911, A131027, A131028, A131029, A131030.

Programs

  • Magma
    m:=105; [ [2, 2, 1, 0, 0, 1][(n-1) mod 6 + 1]: n in [1..m] ];
  • Mathematica
    PadRight[{},120,{2,2,1,0,0,1}] (* or *) LinearRecurrence[{2,-2,1},{2,2,1},120] (* Harvey P. Dale, Jul 16 2012 *)
  • PARI
    {m=105; for(n=1, m, r=(n-1)%6; print1(if(r<2, 2, if(r==2||r==5, 1, 0)), ","))}
    

Formula

a(1) = a(2) = 2, a(3) = 1, a(4) = a(5) = 0, a(6) = 1; for n > 6, a(n) = a(n-6).
G.f.: (2-2*x+x^2)/((1-x)*(1-x+x^2)).
a(n) = A021823(n+2).
a(n) = floor(((n+3) mod 6)/4)+floor(((n+2) mod 3)/2). - Gary Detlefs, Oct 02 2013
a(n) = 1+2/sqrt(3)*sin(Pi/3*n). - Werner Schulte, Jul 21 2017