OFFSET
0,3
COMMENTS
(1,-1,2,-2,3,-3,...) = ((-1)^n)*(1+floor(n/2)), which results from A001057 by removing its initial 0.
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,3,1,-2,-1).
FORMULA
a(n) = 3*a(n-2)+a(n-3)-2*a(n-4)-a(n-5).
G.f.: 1/((1 + x)^2 * (1 - 2*x + x^3)).
From Vladimir Reshetnikov, Oct 29 2015: (Start)
a(n) = Fibonacci(n+1) + ((-1)^n*(2*n+1)-1)/4, where Fibonacci(n) = A000045(n).
Recurrence (4-term): a(0) = 1, a(1) = 0, a(2) = 3, (2*n+1)*a(n) = n + 1 - 2*a(n-1) + 4*(n+1)*a(n-2) + (2*n+3)*a(n-3).
(End)
From Colin Barker, Mar 16 2016: (Start)
a(n) = (-5-5*(-1)^n+2^(1-n)*sqrt(5)*(-(1-sqrt(5))^(1+n)+(1+sqrt(5))^(1+n))+10*(-1)^n*(1+n))/20.
a(n) = (sqrt(5)*2^(1-n)*((1+sqrt(5))^(n+1)-(1-sqrt(5))^(n+1))+10*(n+1)-10)/20 for n even.
a(n) = (sqrt(5)*2^(1-n)*((1+sqrt(5))^(n+1)-(1-sqrt(5))^(n+1))-10*(n+1))/20 for n odd.
(End)
EXAMPLE
a(5) = (1,-1,2,-2,3,-3)**(1,1,2,3,5,8)=1*8-1*5+2*3-2*2+3*1-3*1 = 5.
MATHEMATICA
f[x_] := (1 - x^2) (1 + x); g[x] := 1 - x - x^2;
s = Normal[Series[1/(f[x] g[x]), {x, 0, 60}]]
c = CoefficientList[s, x] (* A213043 *)
LinearRecurrence[{0, 3, 1, -2, -1}, {1, 0, 3, 1, 7}, 60]
Table[Fibonacci[n+1] + ((-1)^n (2n+1) - 1)/4, {n, 0, 20}] (* Vladimir Reshetnikov, Oct 29 2015 *)
PROG
(PARI) Vec(1/((1-x)*(1+x)^2*(1-x-x^2)) + O(x^50)) \\ Colin Barker, Mar 16 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jun 10 2012
STATUS
approved