OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (8,-19,12).
FORMULA
From Colin Barker, Aug 02 2012: (Start)
a(n) = 8*a(n-1) - 19*a(n-2) + 12*a(n-3) for n > 3.
G.f.: 2*x*(1-6*x+12*x^2)/(1-8*x+19*x^2-12*x^3). (End)
MATHEMATICA
LinearRecurrence[{8, -19, 12}, {0, 2, 4, 18}, 31] (* G. C. Greubel, Dec 26 2022 *)
PROG
(Magma) I:=[2, 4, 18]; [0] cat [n le 3 select I[n] else 8*Self(n-1) -19*Self(n-2) +12*Self(n-3): n in [1..31]]; // G. C. Greubel, Dec 26 2022
(SageMath)
@CachedFunction
def a(n): # a = A120664
if (n<4): return (0, 2, 4, 18)[n]
else: return 8*a(n-1) -19*a(n-2) +12*a(n-3)
[a(n) for n in range(41)] # G. C. Greubel, Dec 26 2022
CROSSREFS
KEYWORD
nonn,easy,less
AUTHOR
Roger L. Bagula, Aug 11 2006
EXTENSIONS
Edited by N. J. A. Sloane, Jul 13 2007
New name from Colin Barker, Aug 02 2012
STATUS
approved