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!)
A260686 Period 6 zigzag sequence, repeat [0, 1, 2, 3, 2, 1]. 11

%I #43 Mar 21 2024 08:37:17

%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].

%C Decimal expansion of 37/3003. - _Elmo R. Oliveira_, Mar 06 2024

%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) = a(n-6) for n >= 6. - _Wesley Ivan Hurt_, Sep 07 2022

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

%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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

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