Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #22 Dec 12 2023 09:15:08
%S 1,1,-2,-1,-1,2,1,1,-2,-1,-1,2,1,1,-2,-1,-1,2,1,1,-2,-1,-1,2,1,1,-2,
%T -1,-1,2,1,1,-2,-1,-1,2,1,1,-2,-1,-1,2,1,1,-2,-1,-1,2,1,1,-2,-1,-1,2,
%U 1,1,-2,-1,-1,2,1,1,-2,-1,-1,2,1,1,-2,-1,-1,2,1,1,-2,-1,-1,2,1,1,-2,-1,-1,2,1,1,-2,-1,-1,2,1,1,-2,-1,-1
%N Period 6: repeat [1, 1, -2, -1, -1, 2].
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,-1).
%F a(n) = A061347(n+1) * (-1)^floor(n/3).
%F From _Wesley Ivan Hurt_, Jun 21 2016: (Start)
%F G.f.: (1+x-2*x^2)/(1+x^3).
%F a(n) + a(n-3) = 0 for n>2.
%F a(n) = (5*cos(n*Pi/3) - 2*cos(n*Pi) - sqrt(3)*sin(n*Pi/3))/3. (End)
%p A132419:=n->[1, 1, -2, -1, -1, 2][(n mod 6)+1]: seq(A132419(n), n=0..100); # _Wesley Ivan Hurt_, Jun 21 2016
%t PadRight[{}, 100, {1, 1, -2, -1, -1, 2}] (* _Wesley Ivan Hurt_, Jun 21 2016 *)
%o (PARI) a(n)=[1,1,-2,-1,-1,2][n%6+1] \\ _Charles R Greathouse IV_, Jun 02 2011
%o (Magma) &cat [[1, 1, -2, -1, -1, 2]^^20]; // _Wesley Ivan Hurt_, Jun 21 2016
%Y Cf. A061347.
%K sign,easy,less
%O 0,3
%A _Paul Curtz_, Nov 13 2007
%E Comment changed to formula by _Wesley Ivan Hurt_, Jun 21 2016