OFFSET
0,4
COMMENTS
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,4,5,2,-1,1).
FORMULA
a(n) = a(n-1) + 4*a(n-2) + 5*a(n-3) + 2*a(n-4) - a(n-5) + a(n-6).
G.f.: (x+1)*(2*x^2+2*x-1)/(x^6-x^5+2*x^4+5*x^3+4*x^2+x-1). - Colin Barker, Aug 31 2012
EXAMPLE
The first six polynomials and reductions:
1 -> 1
x -> 2
2*x^2 -> 2*x^2
3*x^3 -> 3 + 3*x + 3*x^2
5*x^4 -> 5 + 10*x + 10*x^2
8*x^5 -> 16 + 24*x + 32*x^2
MATHEMATICA
q = x^3; s = x^2 + x + 1; z = 22;
p[0, x_] := 1; p[1, x_] := x;
p[n_, x_] := p[n - 1, x]*x + p[n - 2, x]*x^2;
Table[Expand[p[n, x]], {n, 0, 7}]
reduce[{p1_, q_, s_, x_}]:= FixedPoint[(s PolynomialQuotient @@ #1 + PolynomialRemainder @@ #1 &)[{#1, q, x}] &, p1]
t = Table[reduce[{p[n, x], q, s, x}], {n, 0, z}];
u1 = Table[Coefficient[Part[t, n], x, 0], {n, 1, z}] (* A192911 *)
u2 = Table[Coefficient[Part[t, n], x, 1], {n, 1, z}] (* A192912 *)
u3 = Table[Coefficient[Part[t, n], x, 2], {n, 1, z}] (* A192913 *)
LinearRecurrence[{1, 4, 5, 2, -1, 1}, {1, 0, 0, 3, 5, 16}, 28] (* Ray Chandler, Aug 02 2015 *)
PROG
(PARI) my(x='x+O('x^30)); Vec((x+1)*(2*x^2+2*x-1)/(x^6-x^5+2*x^4+5*x^3 +4*x^2+x-1)) \\ G. C. Greubel, Jan 12 2019
(Magma) m:=30; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!( (x+1)*(2*x^2+2*x-1)/(x^6-x^5+2*x^4+5*x^3+4*x^2+x-1) )); // G. C. Greubel, Jan 12 2019
(Sage) ((x+1)*(2*x^2+2*x-1)/(x^6-x^5+2*x^4+5*x^3+4*x^2+x-1)).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Jan 12 2019
(GAP) a:=[1, 0, 0, 3, 5, 16];; for n in [7..30] do a[n]:=a[n-1]+4*a[n-2] + 5*a[n-3]+2*a[n-4]-a[n-5]+a[n-6]; od; a; # G. C. Greubel, Jan 12 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jul 12 2011
STATUS
approved