OFFSET
1,2
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.: 4*x^2/( (1+x)*(1-x)^2).
a(n) = 2*A052928(n).
a(n) = A008586(floor(n/2)). (End)
a(n) = 2*n - 2*(n mod 2). - Wesley Ivan Hurt, Jun 30 2013
E.g.f.: (1 + (2*x - 1)*exp(2*x))*exp(-x). - G. C. Greubel, Jul 16 2016
MATHEMATICA
CoefficientList[Series[4 x / ((1+x) (1-x)^2), {x, 0, 70}], x] (* Vincenzo Librandi, May 14 2013 *)
LinearRecurrence[{1, 1, -1}, {0, 4, 4}, 50] (* G. C. Greubel, Jul 16 2016 *)
PROG
(Magma) [2*n-1 + (-1)^n: n in [1..70]] // Vincenzo Librandi, May 14 2013
(PARI) a(n)=2*n-1+(-1)^n \\ Charles R Greathouse IV, Oct 07 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Nov 22 2009
STATUS
approved