OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..5000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
From R. J. Mathar, Aug 21 2009: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3).
G.f.: x*(1+4*x-x^2)/((1+x)*(1-x)^2). (End)
a(n) = 4*n - 2 - a(n-1), with a(1)=1. - Vincenzo Librandi, Nov 30 2010
E.g.f.: (2*x+1)*cosh(x) +(2*x-1)* sinh(x) -1. - G. C. Greubel, Aug 24 2017
Sum_{n>=1} 1/a(n)^2 = Pi^2/8 + G - 1, where G is Catalan's constant (A006752). - Amiram Eldar, Aug 21 2022
MATHEMATICA
LinearRecurrence[{1, 1, -1}, {1, 5, 5}, 50] (* or *) Table[2*n + (-1)^n, {n, 1, 50}] (* G. C. Greubel, Aug 24 2017 *)
PROG
(PARI) a(n)=n+n+(-1)^n \\ Charles R Greathouse IV, Jun 09 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Juri-Stepan Gerasimov, Aug 09 2009
EXTENSIONS
Link by Charles R Greathouse IV, Mar 25 2010
STATUS
approved