A132367 Period 6: repeat [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, -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, 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
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,0,-1).
Programs
-
Magma
&cat[[1, 1, 2, -1, -1, -2]^^20]; // Wesley Ivan Hurt, Jun 19 2016
-
Maple
A132367:=n->[1, 1, 2, -1, -1, -2][(n mod 6)+1]: seq(A132367(n), n=0..100); # Wesley Ivan Hurt, Jun 19 2016
-
Mathematica
PadRight[{}, 120, {1,1,2,-1,-1,-2}] (* Harvey P. Dale, Jul 28 2012 *)
-
PARI
a(n)=[1,1,2,-1,-1,-2][n%6+1] \\ Charles R Greathouse IV, Jun 02 2011
Formula
a(n) = cos(Pi*n/3)/3+sqrt(3)*sin(Pi*n/3)+2*(-1)^n/3. - R. J. Mathar, Oct 08 2011
From Wesley Ivan Hurt, Jun 19 2016: (Start)
G.f.: (1+x+2*x^2)/(1+x^3).
a(n) + a(n-3) = 0 for n>2. (End)
Comments