OFFSET
0,2
COMMENTS
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..500
Index entries for linear recurrences with constant coefficients, signature (6,-8).
FORMULA
a(n) = 3*(5*4^n - 2*2^n)/8 for n > 0.
G.f.: (1-x)*(1+x)/((1-2*x)*(1-4*x)).
E.g.f.: (1/8)*(-1 - 6*exp(2*x) + 15*exp(4*x)). - G. C. Greubel, Dec 02 2021
MATHEMATICA
Table[If[n==0, 1, 3*(5*4^n - 2*2^n)/8], {n, 0, 30}] (* G. C. Greubel, Dec 02 2021 *)
LinearRecurrence[{6, -8}, {1, 6, 27}, 30] (* Harvey P. Dale, Oct 25 2023 *)
PROG
(PARI) {m=21; v=concat([1, 6, 27], vector(m-3)); for(n=4, m, v[n]=6*v[n-1]-8*v[n-2]); v}
(Magma) I:=[6, 27]; [1] cat [n le 2 select I[n] else 6*Self(n-1) - 8*Self(n-2): n in [1..30]]; // G. C. Greubel, Dec 02 2021
(Sage) [1]+[3*(5*4^n - 2*2^n)/8 for n in (1..30)] # G. C. Greubel, Dec 02 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Klaus Brockhaus, Dec 09 2009
STATUS
approved