OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
G.f.: x*(3 + x^2)/( (1+x)*(x-1)^2 ). - R. J. Mathar, Jan 05 2011
a(n) = a(n-1) +a(n-2) -a(n-3). - Vincenzo Librandi, Sep 16 2013
E.g.f.: (-1 + exp(x) + 2*x*exp(2*x))*exp(-x). - G. C. Greubel, Jul 16 2016
MATHEMATICA
CoefficientList[Series[(3 + x^2)/((1 + x) (x - 1)^2), {x, 0, 70}], x] (* Vincenzo Librandi, Sep 16 2013 *)
LinearRecurrence[{1, 1, -1}, {3, 3, 7}, 50] (* G. C. Greubel, Jul 16 2016 *)
PROG
(Magma) [2*n-(-1)^n: n in [1..70]]; // Vincenzo Librandi, Sep 16 2013
(PARI) a(n)=2*n-(-1)^n \\ Charles R Greathouse IV, Jul 16 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Nov 22 2009
EXTENSIONS
New definition by R. J. Mathar, Jan 05 2011
STATUS
approved