login
A131185
Period 6: repeat [0, 2, -1, 0, -1, 3].
1
0, 2, -1, 0, -1, 3, 0, 2, -1, 0, -1, 3, 0, 2, -1, 0, -1, 3, 0, 2, -1, 0, -1, 3, 0, 2, -1, 0, -1, 3, 0, 2, -1, 0, -1, 3, 0, 2, -1, 0, -1, 3, 0, 2, -1, 0, -1, 3, 0, 2, -1, 0, -1, 3, 0, 2, -1, 0, -1, 3, 0, 2, -1, 0, -1, 3, 0, 2, -1, 0, -1, 3, 0, 2, -1, 0, -1, 3, 0, 2, -1, 0, -1, 3, 0, 2, -1, 0, -1, 3
OFFSET
0,2
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
Sequence in context: A129558 A353414 A267181 * A307819 A286354 A296067
KEYWORD
sign,easy
AUTHOR
Paul Curtz, Sep 25 2007
EXTENSIONS
More periods from R. J. Mathar, Feb 07 2009
STATUS
approved