OFFSET
3,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 3..1002
Index entries for linear recurrences with constant coefficients, signature (3,-2,0,-1,1).
FORMULA
From Colin Barker, Feb 19 2016: (Start)
a(n) = 3*a(n-1) - 2*a(n-2) - a(n-4) + a(n-5) for n>6.
G.f.: x^3*(1+5*x+x^2-x^3-2*x^4)/((1-x)^2*(1-x-x^2-x^3)). (End)
a(n) = A001590(n+4) -2*n -4, n>=3. - R. J. Mathar, Jun 15 2020
MAPLE
seq(coeff(series(x^3*(1+5*x+x^2-x^3-2*x^4)/((1-x)^2*(1-x-x^2-x^3)), x, n+1), x, n), n = 3..33); # G. C. Greubel, Nov 05 2019
MATHEMATICA
LinearRecurrence[{3, -2, 0, -1, 1}, {1, 8, 23, 52, 107}, 30] (* G. C. Greubel, Nov 05 2019 *)
PROG
(PARI) my(x='x+O('x^33)); Vec( x^3*(1+5*x+x^2-x^3-2*x^4)/((1-x)^2*(1-x-x^2-x^3)) ) \\ G. C. Greubel, Nov 05 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 33); Coefficients(R!( x^3*(1+5*x+x^2-x^3-2*x^4)/((1-x)^2*(1-x-x^2-x^3)) )); // G. C. Greubel, Nov 05 2019
(Sage)
def A027053_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( x^3*(1+5*x+x^2-x^3-2*x^4)/((1-x)^2*(1-x-x^2-x^3)) ).list()
a=A027053_list(33); a[3:] # G. C. Greubel, Nov 05 2019
(GAP) a:=[1, 8, 23, 52, 107];; for n in [6..33] do a[n]:=3*a[n-1]-2*a[n-2] -a[n-4]+a[n-5]; od; a; # G. C. Greubel, Nov 05 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved