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
From R. J. Mathar, Jan 05 2011: (Start)
G.f.: 2*x*(1 - x + x^2) / ( (1+x)*(x-1)^2 ).
a(n) = 2*A028242(n-1). (End)
a(n) = a(n*1) +a(n-2) -a(n-3). - Vincenzo Librandi, Sep 15 2013
a(n) = ceiling((n+1)/2) + floor((n+2)/2) - 4*mod(n+1,2). - Wesley Ivan Hurt, Aug 20 2014
E.g.f.: (1/2)*(-3 + 4*exp(x) + (2*x - 1)*exp(2*x))*exp(-x). - G. C. Greubel, Jul 16 2016
Sum_{n>=3} (-1)^n/a(n) = 1/2. - Amiram Eldar, Feb 25 2023
MAPLE
MATHEMATICA
CoefficientList[Series[2 (1 + x^2 - x)/((1 + x) (x - 1)^2), {x, 0, 100}], x] (* Vincenzo Librandi, Sep 16 2013 *)
LinearRecurrence[{1, 1, -1}, {2, 0, 4}, 50] (* G. C. Greubel, Jul 16 2016 *)
PROG
(Magma) [n-1/2-3*(-1)^n/2: n in [1..60]]; // Vincenzo Librandi, Sep 16 2013
(PARI) vector(80, n, n - 1/2 - 3*(-1)^n/2) \\ Michel Marcus, Aug 21 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Nov 21 2009
EXTENSIONS
New definition by R. J. Mathar, Jan 05 2011
STATUS
approved