OFFSET
1,2
COMMENTS
If grouped into blocks of four,
1, 3, 1, -3,
-5, -7, -1, 7,
9, 11, 1, -11,
-13, -15, -1, 15
17, 19, 1, -19.
we see that a(4n+1) + a(4n+2) + a(4n+3) + a(4n+4) = (-1)^n*(2+4*n).
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,0,0,-2,0,0,0,-1).
FORMULA
a(n) = -2*a(n-4) - a(n-8). a(n) + a(n-4) = period length 8: repeat -4, -4, 0, 4, 4, 4, 0 -4.
G.f. x*(x-1)*(x^4-2*x-1)*(1+x)^2 / (x^4+1)^2. - R. J. Mathar, Jun 02 2011
a(n) = (-1)^floor(n/4)*(1+3*n+(n-1)*(-1)^n-4*cos(n*Pi/2)+2*(n-1)*sin(n*Pi/2) )/4. - Wesley Ivan Hurt, May 08 2021
PROG
(PARI) Vec(x*(x-1)*(x^4-2*x-1)*(1+x)^2 / (x^4+1)^2+O(x^99)) \\ Charles R Greathouse IV, Jun 08 2011
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Paul Curtz, Apr 22 2011
EXTENSIONS
More terms from Jinyuan Wang, Feb 26 2020
STATUS
approved