OFFSET
0,5
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (6,-12,9).
FORMULA
b(n) = a(n) with one 0; c(n)=1, 3, 6, 9, 9, 0, -27, ... = A057083; b(n+1) = 3*b(n) + c(n)?
From R. J. Mathar, Apr 02 2008: (Start)
O.g.f.: x^3/((1-3*x)*(1-3*x+3*x^2)).
a(n) = 6*a(n-1) - 12*a(n-2) + 9*a(n-3). (End)
MAPLE
seq(coeff(series(x^3/((1-3*x)(1-3*x+3*x^2)), x, n+1), x, n), n = 0 .. 40); # G. C. Greubel, Nov 21 2019
MATHEMATICA
LinearRecurrence[{6, -12, 9}, {0, 0, 0, 1}, 30] (* G. C. Greubel, Nov 21 2019 *)
PROG
(PARI) my(x='x+O('x^30)); concat([0, 0, 0], Vec(x^3/((1-3*x)*(1-3*x+3*x^2)))) \\ G. C. Greubel, Nov 21 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 30); [0, 0, 0] cat Coefficients(R!( x^3/((1-3*x)*(1-3*x+3*x^2)) )); // G. C. Greubel, Nov 21 2019
(Sage)
def A133474_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P(x^3/((1-3*x)*(1-3*x+3*x^2))).list()
A133474_list(30) # G. C. Greubel, Nov 21 2019
(GAP) a:=[0, 0, 1];; for n in [4..30] do a[n]:=6*a[n-1]-12*a[n-2]+9*a[n-3]; od; a; # G. C. Greubel, Nov 21 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Nov 29 2007
STATUS
approved