OFFSET
0,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Richard Choulet Curtz-like transformation
Index entries for linear recurrences with constant coefficients, signature (3,-2,1).
FORMULA
O.g.f.: 2+4*x -x^2*(9-4*x+3*x^2) / ( -1+3*x-2*x^2+x^3 ).
a(0)=2, a(1)=4, a(2)=9, a(3)=23, a(4)=54 and for n>=2 a(n+3)=3*a(n+2)-2*a(n+1)+a(n).
MATHEMATICA
Join[{2, 4}, LinearRecurrence[{3, -2, 1}, {9, 23, 54}, 50]] (* G. C. Greubel, Jun 26 2018 *)
PROG
(PARI) x='x+O('x^30); Vec(2+4*x -x^2*(9-4*x+3*x^2)/(-1+3*x-2*x^2+x^3)) \\ G. C. Greubel, Jun 26 2018
(Magma) I:=[9, 23, 54]; [2, 4] cat [n le 3 select I[n] else 3*Self(n-1) - 2*Self(n-2) + Self(n-3): n in [1..30]]; // G. C. Greubel, Jun 26 2018
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Richard Choulet, Apr 10 2009
STATUS
approved