OFFSET
0,2
COMMENTS
First differences of A085278.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..200
Index entries for linear recurrences with constant coefficients, signature (1,2).
FORMULA
a(n) = A001045(n+3) for n > 0.
a(n) = a(n-1) + 2*a(n-2) for n > 2; a(0) = 1, a(1) = 5, a(2) = 11.
G.f.: (1 + 2*x)^2/((1+x)*(1-2*x)).
E.g.f.: (8*exp(2*x) - 6 + exp(-x))/3. - G. C. Greubel, Jul 28 2016
MATHEMATICA
Table[(8*2^n +(-1)^n)/3 - 2*Boole[n==0], {n, 0, 40}] (* or *) LinearRecurrence[{1, 2}, {1, 5, 11}, 40] (* G. C. Greubel, Jul 28 2016; Feb 05 2021 *)
PROG
(Magma) [1] cat [ (8*2^n+(-1)^n)/3: n in [1..30] ];
(PARI) a(n)=([0, 1; 2, 1]^n*[1; 5])[1, 1] \\ Charles R Greathouse IV, Jul 29 2016
(Sage) [1]+[(2^(n+3) +(-1)^n)/3 for n in (1..40)] # G. C. Greubel, Feb 05 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Klaus Brockhaus, Dec 01 2009
STATUS
approved