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
a(n) = 4*n - a(n-1) - 4, with n>1, a(1)=2.
from R. J. Mathar, Nov 25 2009: (Start)
a(n) = 2*n - (-1)^n - 1.
a(n) = 2*A109613(n-1).
G.f.: 2*x*(1 + x^2)/((1+x)*(1-x)^2). (End)
a(n) = a(n-1) + a(n-2) - a(n-3). - Vincenzo Librandi, Sep 16 2013
a(n) = A168277(n) + 1. - Vincenzo Librandi, Sep 17 2013
E.g.f.: (-1 + 2*exp(x) + (2*x -1)*exp(2*x))*exp(-x). - G. C. Greubel, Jul 16 2016
Sum_{n>=1} 1/a(n)^2 = Pi^2/16. - Amiram Eldar, Aug 21 2022
MATHEMATICA
CoefficientList[Series[2 (1 + x^2) / ((1 + x) (1 - x)^2), {x, 0, 80}], x] (* Vincenzo Librandi, Sep 16 2013 *)
Table[2 n - 1 - (-1)^n, {n, 70}] (* Bruno Berselli, Sep 17 2013 *)
LinearRecurrence[{1, 1, -1}, {2, 2, 6}, 70] (* Harvey P. Dale, Oct 22 2014 *)
PROG
(Magma) [2*n-1-(-1)^n: n in [1..70]]; // Vincenzo Librandi, Sep 16 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Nov 22 2009
EXTENSIONS
Previous definition replaced with closed-form expression by Bruno Berselli, Sep 17 2013
STATUS
approved