login
The OEIS is supported by the many generous donors to the OEIS 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
FORMULA
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(n) = a(n-1) - a(n-2) + a(n-3) - a(n-4) + a(n-5) for n > 4; a(0)=0, a(1)=0, a(2)=1, a(3)=1, a(4)=2. - 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
a(n) = floor(n/2) - 3*floor(n/6). - Ridouane Oudra, Apr 01 2023
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
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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 14:38 EDT 2024. Contains 371254 sequences. (Running on oeis4.)