OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
a(n) = n^2 + n + 1 - n*(-1)^n = n^2 + n + 1 + n*(-1)^(n+1).
G.f.: (5*x^3-x^2+3*x+1)/((1-x)^3*(1+x)^2). - Colin Barker, Sep 03 2012
From Amiram Eldar, Feb 03 2026: (Start)
Sum_{n>=0} 1/a(n) = 1/2 + coth(Pi/2)*Pi/4 + Pi^2/24.
Sum_{n>=0} (-1)^n/a(n) = 1/2 + coth(Pi/2)*Pi/4 - Pi^2/24. (End)
MATHEMATICA
CoefficientList[Series[(5 x^3 - x^2 + 3 x + 1) / ((1 - x)^3 (1 + x)^2), {x, 0, 50}], x] (* Vincenzo Librandi, Aug 08 2013 *)
PROG
(Magma) [n^2+n+1-n*(-1)^n: n in [0..50]]; // Vincenzo Librandi, Aug 08 2013
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Mar 19 2003
STATUS
approved
