OFFSET
0,2
COMMENTS
Diagonal sums of A114284.
LINKS
FORMULA
a(n) = Sum_{k=0..floor(n/2)} 3*0^(n-2k) - 2.
a(n) = 3*(1 + (-1)^n)/2 - 2*floor((n+2)/2).
a(n) = - A103889(n). - R. J. Mathar, Apr 06 2008
From Wesley Ivan Hurt, Sep 06 2015: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3), n > 2.
a(n) = (-1)^n - n. (End)
E.g.f.: exp(-x) - x*exp(x). - Stefano Spezia, May 03 2023
MAPLE
MATHEMATICA
Table[(-1)^n-n, {n, 0, 70}] (* Wesley Ivan Hurt, Sep 06 2015 *)
CoefficientList[Series[(1 - 3 x)/((1 - x) (1 - x^2)), {x, 0, 70}] , x] (* Vincenzo Librandi, Sep 07 2015 *)
LinearRecurrence[{1, 1, -1}, {1, -2, -1}, 70] (* Harvey P. Dale, Jul 24 2019 *)
PROG
(Magma) [(-1)^n-n : n in [0..70]]; // Wesley Ivan Hurt, Sep 06 2015
(Magma) I:=[1, -2, -1]; [n le 3 select I[n] else Self(n-1)+Self(n-2)-Self(n-3): n in [1..70]]; // Vincenzo Librandi, Sep 07 2015
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Paul Barry, Nov 20 2005
STATUS
approved