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 (6,1,-30).
FORMULA
From Colin Barker, Nov 01 2012: (Start)
a(n) = 6*a(n-1) + a(n-2) - 30*a(n-3) for n>3.
G.f.: x*(12 +101*x -189*x^2)/((1+2*x)*(1-3*x)*(1-5*x)). (End)
MATHEMATICA
LinearRecurrence[{6, 1, -30}, {0, 12, 173, 861}, 20] (* Harvey P. Dale, Jan 09 2019 *)
PROG
(Magma) I:=[12, 173, 861]; [0] cat [n le 3 select I[n] else 6*Self(n-1) + Self(n-2) -30*Self(n-3): n in [1..31]]; // G. C. Greubel, Dec 25 2022
(SageMath)
@CachedFunction
def a(n): # a = A120662
if (n<4): return (0, 12, 173, 861)[n]
else: return 6*a(n-1) + a(n-2) -30*a(n-3)
[a(n) for n in range(41)] # G. C. Greubel, Dec 25 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, Aug 10 2006
EXTENSIONS
Edited by N. J. A. Sloane, Jul 13 2007
Meaningful name using g.f. from Joerg Arndt, Dec 26 2022
STATUS
approved