OFFSET
0,2
COMMENTS
Also the main diagonal of A138057.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
Index entries for linear recurrences with constant coefficients, signature (-2,-1).
FORMULA
From G. C. Greubel, Nov 02 2017: (Start)
a(n) = -2*a(n-1) - a(n-2).
G.f.: -x*(x+2)/(1+x)^2.
E.g.f.: (1 - x - exp(x))*exp(-x). (End)
MATHEMATICA
Join[{0}, Table[(-1)^n*(n + 1), {n, 1, 50}]] (* G. C. Greubel, Nov 02 2017 *)
LinearRecurrence[{-2, -1}, {0, -2, 3}, 80] (* Harvey P. Dale, Dec 03 2022 *)
PROG
(PARI) a(n)=if(n, (n+1)*(-1)^n, 0) \\ Charles R Greathouse IV, Sep 01 2015
(Magma) [0] cat [(-1)^n*(n+1): n in [1..50]]; // G. C. Greubel, Nov 02 2017
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Paul Curtz, Sep 19 2007
EXTENSIONS
Edited by R. J. Mathar, Jul 07 2008
STATUS
approved