OFFSET
0,5
COMMENTS
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (-2,-1).
FORMULA
G.f.: x*(1+2*x)/(1+x)^2.
a(n) = (n-2)*(-1)^n + 2*0^n.
a(n) = -2*a(n-1) - a(n-2) for n > 2.
a(n) = A099570(n) for n > 1. - R. J. Mathar, Dec 15 2008
a(n) = (Sum_{k=1..n} k*(-1)^(n-k)*binomial(n-1,k-1)*binomial(2*n-k-1,n-1))/n, n>0, a(0)=0. - Vladimir Kruchinin, Mar 09 2014
a(n) = A038608(n-2) for n > 2. - Georg Fischer, Oct 06 2018
E.g.f.: 2 - exp(-x)*(2 + x). - Stefano Spezia, Mar 07 2023
MAPLE
MATHEMATICA
CoefficientList[Series[x (1 + 2 x)/(1 + x)^2, {x, 0, 100}], x] (* Vincenzo Librandi, Mar 11 2014 *)
PROG
(Magma) [0] cat [(n-2)*(-1)^n : n in [1..100]]; // Wesley Ivan Hurt, Dec 11 2016
(PARI) a(n)=if(n, (n-2)*(-1)^n, 0) \\ Charles R Greathouse IV, Dec 13 2016
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Paul Barry, Jul 29 2004
STATUS
approved