OFFSET
0,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,4).
FORMULA
From Colin Barker, Nov 13 2012: (Start)
a(n) = (-2*(7*(-1)^n - 2^(1 + 2*n)))/5 for n > 0.
a(n) = 3*a(n-1) + 4*a(n-2) for n > 2.
G.f.: 2*(8*x^2 - 1)/((x + 1)*(4*x - 1)). (End)
E.g.f.: (20 - 14*exp(-x) + 4*exp(4*x))/5. - Franck Maminirina Ramaharo, Nov 23 2018
MATHEMATICA
Join[{2}, LinearRecurrence[{3, 4}, {6, 10}, 50]]
PROG
(Maxima) (a[0] : 2, a[1] : 6, a[2] : 10, a[n] := 3*a[n-1] + 4*a[n-2], makelist(a[n], n, 0, 50)); /* Franck Maminirina Ramaharo, Nov 23 2018 */
(PARI) x='x+O('x^50); Vec(2*(8*x^2-1)/((x+1)*(4*x-1))) \\ G. C. Greubel, Nov 23 2018
(Magma) I:=[6, 10]; [2] cat [n le 2 select I[n] else 3*Self(n-1) + 4*Self(n-2): n in [1..49]]; // G. C. Greubel, Nov 23 2018
(Sage) s=(2*(8*x^2-1)/((x+1)*(4*x-1))).series(x, 50); s.coefficients(x, sparse=False) # G. C. Greubel, Nov 23 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, Mar 06 2006
EXTENSIONS
Edited, and new name from Franck Maminirina Ramaharo, Nov 23 2018, after Colin Barker's formula
STATUS
approved