OFFSET
0,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,0,-3,-1).
FORMULA
From Colin Barker, Jun 22 2012: (Start)
a(n) = 3*a(n-1) - 3*a(n-3) - a(n-4).
G.f.: (2-4*x-x^2)/((1-x-x^2)*(1-2*x-x^2)). (End)
EXAMPLE
a(6) = Lucas(6) + Pell(6) = 18 + 70 = 88.
MAPLE
gfpell := x/(1-2*x-x^2): gfluc := (2-x)/(1-x-x^2): s := series(gfpell+gfluc, x, 100): for i from 0 to 60 do printf(`%d, `, coeff(s, x, i)) od:
MATHEMATICA
LinearRecurrence[{3, 0, -3, -1}, {2, 2, 5, 9}, 30] (* Harvey P. Dale, Jun 05 2017 *)
PROG
(Magma) I:=[2, 2, 5, 9]; [n le 4 select I[n] else 3*Self(n-1)-3*Self(n-3)-Self(n-4): n in [1..30]]; // Vincenzo Librandi, Juan 07 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Apr 05 2001
EXTENSIONS
More terms from James A. Sellers, Apr 06 2001
STATUS
approved