OFFSET
1,2
LINKS
David Lovler, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
From R. J. Mathar, Sep 19 2008: (Start)
a(n) = 4*n - 5 - (-1)^n = 2*A042948(n-1).
G.f.: 2*x^2*(1+3x)/((1-x)^2*(1+x)). (End)
a(n) = 8*n - a(n-1) - 14 with a(1)=0. - Vincenzo Librandi, Aug 06 2010
a(n+1) = Sum_{k>=0} A030308(n,k)*b(k) with b(0)=2 and b(k)=2^(k+2)for k > 0. - Philippe Deléham, Oct 17 2011
a(n) = floor((8/3)*floor(3*n/2)). - Clark Kimberling, Jul 04 2012
Sum_{n>=2} (-1)^n/a(n) = Pi/16 + 3*log(2)/8. - Amiram Eldar, Dec 18 2021
E.g.f.: 6 + (4*x - 5)*exp(x) - exp(-x). - David Lovler, Jul 22 2022
MATHEMATICA
{#, #+2}&/@(8*Range[0, 30])//Flatten (* or *) LinearRecurrence[{1, 1, -1}, {0, 2, 8}, 60] (* Harvey P. Dale, Nov 30 2019 *)
PROG
(PARI) forstep(n=0, 200, [2, 6], print1(n", ")) \\ Charles R Greathouse IV, Oct 17 2011
(PARI) a(n) = 4*n - 5 - (-1)^n; \\ David Lovler, Jul 25 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from Vincenzo Librandi, Aug 06 2010
STATUS
approved