A163980 a(n) = 2*n + (-1)^n.
1, 5, 5, 9, 9, 13, 13, 17, 17, 21, 21, 25, 25, 29, 29, 33, 33, 37, 37, 41, 41, 45, 45, 49, 49, 53, 53, 57, 57, 61, 61, 65, 65, 69, 69, 73, 73, 77, 77, 81, 81, 85, 85, 89, 89, 93, 93, 97, 97, 101, 101, 105, 105, 109, 109, 113, 113, 117, 117, 121, 121, 125, 125, 129, 129, 133
Offset: 1
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).
Programs
-
Mathematica
LinearRecurrence[{1, 1, -1}, {1, 5, 5}, 50] (* or *) Table[2*n + (-1)^n, {n,1,50}] (* G. C. Greubel, Aug 24 2017 *)
-
PARI
a(n)=n+n+(-1)^n \\ Charles R Greathouse IV, Jun 09 2011
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
Extensions
Link by Charles R Greathouse IV, Mar 25 2010