OFFSET
0,2
COMMENTS
First differences are 3, -3, 3, -5, 7, -7, 7, -9, 11, -11, 11, ... .
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (-1,0,0,1,1).
FORMULA
a(n) = (1-(2*n+3)*(-1)^n-2*(-1)^((2*n+1-(-1)^n)/4))/4. - Luce ETIENNE, Sep 04 2016
a(n) = cos((n-1)*Pi)*(2*n+3+2*cos(n*Pi/2)-cos(n*Pi)+2*sin(n*Pi/2))/4. - Wesley Ivan Hurt, Oct 02 2017
From Colin Barker, Oct 05 2017: (Start)
G.f.: -(1 - x - x^2 - x^3) / ((1 - x)*(1 + x)^2*(1 + x^2)).
a(n) = (1 - 3*(-1)^n - (1-i)*(-i)^n - (1+i)*i^n - 2*(-1)^n*n) / 4 were i=sqrt(-1).
(End)
MATHEMATICA
Flatten[Table[{-2n-1, 2n+2, -2n-1, 2n+2}, {n, 0, 20}]] (* Harvey P. Dale, Oct 19 2011 *)
PROG
(Magma) [(1-(2*n+3)*(-1)^n-2*(-1)^((2*n+1-(-1)^n)div 4))/4: n in [0..80]]; // Vincenzo Librandi, Oct 04 2017
(Magma) &cat [[-2*n-1, 2*n+2, -2*n-1, 2*n+2]: n in [0..30]]; // Vincenzo Librandi, Oct 04 2017
(PARI) Vec(-(1 - x - x^2 - x^3) / ((1 - x)*(1 + x)^2*(1 + x^2)) + O(x^100)) \\ Colin Barker, Oct 05 2017
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Paul Curtz, Feb 04 2008
STATUS
approved