OFFSET
1,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Richard Choulet, Curtz-like transformation.
Index entries for linear recurrences with constant coefficients, signature (3,-2,1).
FORMULA
G.f.: z*(2 + z^2)/(1 - 3*z + 2*z^2 - z^3).
a(n+3) = 3*a(n+2) - 2*a(n+1) + a(n) (n>=0). - Richard Choulet, Apr 07 2009
MAPLE
a:= n-> (<<6|2|1>>. <<3|1|0>, <-2|0|1>, <1|0|0>>^n)[1, 3]:
seq(a(n), n=1..40); # Alois P. Heinz, Aug 14 2008
MATHEMATICA
LinearRecurrence[{3, -2, 1}, {2, 6, 15}, 41] (* G. C. Greubel, Apr 12 2021 *)
PROG
(Magma) I:=[2, 6, 15]; [n le 3 select I[n] else 3*Self(n-1) -2*Self(n-2) +Self(n-3): n in [1..41]]; // G. C. Greubel, Apr 12 2021
(Sage)
def A136302_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( x*(2+x^2)/(1-3*x+2*x^2-x^3) ).list()
a=A136302_list(41); a[1:] # G. C. Greubel, Apr 12 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Richard Choulet, Mar 22 2008
EXTENSIONS
More terms from Alois P. Heinz, Aug 14 2008
STATUS
approved