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

%I #39 Dec 12 2023 09:18:29

%S 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,

%T 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,

%U 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

%N Period 6: repeat [0, 0, 1, 1, 2, 2].

%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1,1,-1,1).

%F G.f.: (2*x^2+1)*x^2/((1-x)*(x^2+x+1)*(x^2-x+1)). - _R. J. Mathar_, Nov 14 2007

%F a(n) = floor((n mod 6)/2). - _Gary Detlefs_, Jul 02 2011

%F 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

%F 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

%F a(n) = floor(n/2) mod 3. - _Bruno Berselli_, Oct 03 2017

%F a(n) = floor(n/2) - 3*floor(n/6). - _Ridouane Oudra_, Apr 01 2023

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

%t 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 *)

%o (PARI) a(n)=n%6\2 \\ _Jaume Oliver Lafont_, Aug 28 2009

%o (Magma) &cat [[0, 0, 1, 1, 2, 2]^^20]; // _Wesley Ivan Hurt_, Jun 20 2016

%Y Cf. A105899.

%K nonn,easy

%O 0,5

%A _Paul Curtz_, Aug 27 2007

%E Edited by _N. J. A. Sloane_, Sep 15 2007

%E Formula simplified by _Bruno Berselli_, Sep 27 2010

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 April 25 01:06 EDT 2024. Contains 371964 sequences. (Running on oeis4.)