OFFSET
1,4
REFERENCES
Chang and Sederberg, Over and Over Again, MAA, 1997, Chapter 30
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3,3,-2).
FORMULA
a(n) = 3*a(n-1) + 3*a(n-2) - 2*a(n-3).
a(n) = A100191(n-2) for n > 2. - Georg Fischer, Oct 21 2018
MAPLE
seq(coeff(series(x^2*(1-2*x)/(1-3*x-3*x^2+2*x^3), x, n+1), x, n), n = 1 .. 30); # Muniru A Asiru, Oct 21 2018
MATHEMATICA
M = {{0, 0, 1}, {0, 2, -2}, {1, -2, 1}}; v[1] = {0, 0, 1}; v[n_]:=v[n]=M.v[n-1]; Table[v[n][[1]], {n, 30}]
CoefficientList[Series[x^2*(1-2*x)/(1-3*x-3*x^2+2*x^3), {x, 0, 30}], x] (* G. C. Greubel, Aug 05 2019 *)
PROG
(PARI) concat(0, Vec(-x^2*(2*x-1)/(2*x^3-3*x^2-3*x+1)+O(x^130))) \\ Colin Barker, Feb 10 2015
(PARI) a(n)=([0, 1, 0; 0, 0, 1; -2, 3, 3]^(n-1)*[0; 1; 1])[1, 1] \\ Charles R Greathouse IV, Jun 24 2015
(GAP) a:=[0, 1, 1];; for n in [4..30] do a[n]:=3*a[n-1]+3*a[n-2]-2*a[n-3]; od; a; # Muniru A Asiru, Oct 21 2018
(Magma) R<x>:=PowerSeriesRing(Integers(), 30); [0] cat Coefficients(R!( x^2*(1-2*x)/(1-3*x-3*x^2+2*x^3) )); // G. C. Greubel, Aug 05 2019
(Sage) a=(x^2*(1-2*x)/(1-3*x-3*x^2+2*x^3)).series(x, 30).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Aug 05 2019
CROSSREFS
KEYWORD
nonn,easy,less
AUTHOR
Roger L. Bagula and Gary W. Adamson, Oct 26 2006
EXTENSIONS
Definition replaced with the generating function by the Assoc. Eds. of the OEIS, Mar 28 2010
STATUS
approved