OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,1).
FORMULA
a(n) = a(n-6) for n>5. G.f.: x*(2-x-x^3+3*x^4)/((1-x)*(1+x)*(1+x+x^2)*(1-x+x^2)). - R. J. Mathar, Feb 07 2009
a(n) = sin(n*Pi/3)*(6*sin(n*Pi/3) + 14*sin(2*n*Pi/3) - 2*sqrt(3)*cos(n*Pi/3) - sqrt(3))/6. - Wesley Ivan Hurt, Jun 19 2016
MAPLE
A131185:=n->[0, 2, -1, 0, -1, 3][(n mod 6)+1]: seq(A131185(n), n=0..100); # Wesley Ivan Hurt, Jun 19 2016
MATHEMATICA
PadRight[{}, 120, {0, 2, -1, 0, -1, 3}] (* Harvey P. Dale, Dec 29 2012 *)
PROG
(Magma) &cat[[0, 2, -1, 0, -1, 3]^^20]; // Wesley Ivan Hurt, Jun 19 2016
(PARI) a(n)=[0, 2, -1, 0, -1, 3][n%6+1] \\ Charles R Greathouse IV, Jul 26 2016
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Paul Curtz, Sep 25 2007
EXTENSIONS
More periods from R. J. Mathar, Feb 07 2009
STATUS
approved