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,-99,162).
FORMULA
a(n) = (3^n)*Stirling2(n+3, 3), n >= 0, with Stirling2(n, m) = A008277(n, m).
a(n) = (3^n - 8*6^n + 9*9^n)/2.
G.f.: 1/((1-3*x)*(1-6*x)*(1-9*x)).
E.g.f.: (d^3/dx^3)((((exp(3*x)-1)/3)^3)/3!) = (exp(3*x) - 8*exp(6*x) + 9*exp(9*x))/2.
a(0)=1, a(1)=18, a(2)=225; for n > 2, a(n) = 18*a(n-1) - 99*a(n-2) + 162*a(n-3). - Vincenzo Librandi, Jul 02 2013
a(n) = 15*a(n-1) - 54*a(n-2) + 3^n. - Vincenzo Librandi, Jul 02 2013
MATHEMATICA
CoefficientList[Series[1 / ((1 - 3 x) (1 - 6 x) (1 - 9 x)), {x, 0, 30}], x] (* Vincenzo Librandi, Jul 02 2013 *)
LinearRecurrence[{18, -99, 162}, {1, 18, 225}, 20] (* Harvey P. Dale, Sep 09 2023 *)
PROG
(PARI) Vec(1/((1-3*x)*(1-6*x)*(1-9*x))+O(x^99)) \\ Charles R Greathouse IV, Sep 26 2012
(Magma) m:=20; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(1/((1-3*x)*(1-6*x)*(1-9*x)))); /* or */ I:=[1, 18, 225]; [n le 3 select I[n] else 18*Self(n-1)-99*Self(n-2)+162*Self(n-3): n in [1..20]]; // Vincenzo Librandi, Jul 02 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved