login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A131555 Period 6: repeat [0, 0, 1, 1, 2, 2]. 3
0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 2, 0, 0, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,5

LINKS

Table of n, a(n) for n=0..104.

Index entries for linear recurrences with constant coefficients, signature (1,-1,1,-1,1).

FORMULA

a(n) = (1/30)*(12*(n mod 6)+2*((n+1) mod 6)-3*((n+2) mod 6)+2*((n+3) mod 6)-3*((n+4) mod 6)+2*((n+5) mod 6)). - Paolo P. Lava, Aug 28 2007

G.f.: (2*x^2+1)*x^2/((1-x)*(x^2+x+1)*(x^2-x+1)). - R. J. Mathar, Nov 14 2007

a(n) = floor((n mod 6)/2). - Gary Detlefs, Jul 02 2011

a(0)=0, a(1)=0, a(2)=1, a(3)=1, a(4)=2; for n>4, a(n) = a(n-1)-a(n-2)+a(n-3)- a(n-4)+a(n-5). - Harvey P. Dale, Mar 30 2012

a(n) = (3*sin(n*Pi/6) - sqrt(3)*cos(n*Pi/6)) * (2*sin(n*Pi/6) + sin(n*Pi/2))/3. - Wesley Ivan Hurt, Jun 20 2016

a(n) = floor(n/2) mod 3. - Bruno Berselli, Oct 03 2017

MAPLE

A131555:=n->[0, 0, 1, 1, 2, 2][(n mod 6)+1]: seq(A131555(n), n=0..100); # Wesley Ivan Hurt, Jun 20 2016

MATHEMATICA

PadRight[{}, 120, {0, 0, 1, 1, 2, 2}] (* or *) LinearRecurrence[{1, -1, 1, -1, 1}, {0, 0, 1, 1, 2}, 120] (* Harvey P. Dale, Mar 30 2012 *)

PROG

(PARI) a(n)=n%6\2 \\ Jaume Oliver Lafont, Aug 28 2009

(MAGMA) &cat [[0, 0, 1, 1, 2, 2]^^20]; // Wesley Ivan Hurt, Jun 20 2016

CROSSREFS

Cf. A105899.

Sequence in context: A227838 A050605 A060571 * A293209 A318753 A318757

Adjacent sequences:  A131552 A131553 A131554 * A131556 A131557 A131558

KEYWORD

nonn,easy

AUTHOR

Paul Curtz, Aug 27 2007

EXTENSIONS

Edited by N. J. A. Sloane, Sep 15 2007

Formula simplified by Bruno Berselli, Sep 27 2010

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 29 04:46 EST 2020. Contains 331335 sequences. (Running on oeis4.)