This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A260686 Period 6 zigzag sequence, repeat [0, 1, 2, 3, 2, 1]. 10

%I

%S 0,1,2,3,2,1,0,1,2,3,2,1,0,1,2,3,2,1,0,1,2,3,2,1,0,1,2,3,2,1,0,1,2,3,

%T 2,1,0,1,2,3,2,1,0,1,2,3,2,1,0,1,2,3,2,1,0,1,2,3,2,1,0,1,2,3,2,1,0,1,

%U 2,3,2,1,0,1,2,3,2,1,0,1,2,3,2,1,0,1

%N Period 6 zigzag sequence, repeat [0, 1, 2, 3, 2, 1].

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

%F G.f.: x*(1 + x + x^2) / (1 - x + x^3 - x^4).

%F a(n) = a(n-1) - a(n-3) + a(n-4) for n>3.

%F a(n) = Sum_{i=1..n} (-1)^floor((i-1)/3) for n>0.

%F a(n+1) = a(n) + A130151(n).

%F a(2n) = 2*A011655(n), a(2n+1) = A109007(n+2).

%F a(n) = 1 + (1 - (-1)^n)/2 - (-1)^floor((n+1)/3). [_Bruno Berselli_, Nov 16 2015]

%F a(n) = sin(n*Pi/6)^2*(11+4*cos(n*Pi/3)+2*cos(2*n*Pi/3))/3. - _Wesley Ivan Hurt_, Jun 17 2016

%F a(n) = 3/2-1/6*(-1)^n-2/3*((1/2-(1/2*I)*sqrt(3))^n+(1/2+(1/2*I)*sqrt(3))^n) where I=sqrt(-1). - _Paolo P. Lava_, Jun 17 2016

%p A260686:=n->[0, 1, 2, 3, 2, 1][(n mod 6)+1]: seq(A260686(n), n=0..100);

%t CoefficientList[Series[(x + x^2 + x^3)/(1 - x + x^3 - x^4), {x, 0, 100}], x]

%t Table[1 + (1 - (-1)^n)/2 - (-1)^Floor[(n + 1)/3], {n, 0, 100}] (* _Bruno Berselli_, Nov 16 2015 *)

%t PadRight[{}, 120, {0, 1, 2, 3, 2, 1}] (* _Vincenzo Librandi_, Nov 17 2015 *)

%o (PARI) concat(0, Vec((x+x^2+x^3)/(1-x+x^3-x^4) + O(x^100))) \\ _Altug Alkan_, Nov 15 2015

%o (MAGMA) [1+(1-(-1)^n)/2-(-1)^Floor((n+1)/3): n in [0..100]]; // _Bruno Berselli_, Nov 16 2015

%o (MAGMA) &cat[[0,1,2,3,2,1]: n in [0..15]]; // _Vincenzo Librandi_, Nov 17 2015

%Y Period k zigzag sequences: A000035 (k=2), A007877 (k=4), this sequence (k=6), A266313 (k=8), A271751 (k=10), A271832 (k=12), A279313 (k=14), A279319 (k=16), A158289 (k=18).

%Y Cf. A011655, A109007, A130151.

%K nonn,easy

%O 0,3

%A _Wesley Ivan Hurt_, Nov 15 2015

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.

Last modified March 18 19:58 EDT 2019. Contains 321293 sequences. (Running on oeis4.)