OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..200
Index entries for linear recurrences with constant coefficients, signature (18,-95,126).
FORMULA
a(n) = ((9^n - 2^n)/7 - (7^n - 2^n)/5)/2, n >= 2. - Zerinvary Lajos, Jun 05 2009
a(n) = 18*a(n-1) - 95*a(n-2) + 126*a(n-3). - Vincenzo Librandi, Jun 26 2013
MATHEMATICA
CoefficientList[Series[1 / ((1 - 2 x) (1 - 7 x) (1 - 9 x)), {x, 0, 20}], x] (* Vincenzo Librandi, Jun 26 2013 *)
PROG
(Sage) [((9^n - 2^n)/7-(7^n - 2^n)/5)/2 for n in range(2, 20)] # Zerinvary Lajos, Jun 05 2009
(Magma) I:=[1, 18, 229]; [n le 3 select I[n] else 18*Self(n-1)-95*Self(n-2)+126*Self(n-3): n in [1..20]]; /* or */ m:=20; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(1/((1-2*x)*(1-7*x)*(1-9*x)))); // Vincenzo Librandi, Jun 26 2013
(PARI) x='x+O('x^99); Vec(1/((1-2*x)*(1-7*x)*(1-9*x))) \\ Altug Alkan, Sep 21 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved