A192806 a(n) = 7*a(n-1) - 5*a(n-2) + a(n-3), with initial values a(0) = a(1) = 1, a(2)=4.
1, 1, 4, 24, 149, 927, 5768, 35890, 223317, 1389537, 8646064, 53798080, 334745777, 2082876103, 12960201916, 80641778674, 501774317241, 3122171529233, 19426970897100, 120879712950776, 752145307699165, 4680045560037375, 29120472094716576
Offset: 0
Examples
G.f. = 1 + x + 4*x^2 + 24*x^3 + 149*x^4 + 927*x^5 + 5768*x^6 + ...
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- László Németh, The trinomial transform triangle, J. Int. Seqs., Vol. 21 (2018), Article 18.7.3. Also arXiv:1807.07109 [math.NT], 2018.
- Index entries for linear recurrences with constant coefficients, signature (7,-5,1).
Programs
-
GAP
a:=[1,1,4];; for n in [4..25] do a[n]:=7*a[n-1]-5*a[n-2]+a[n-3]; od; Print(a); # Muniru A Asiru, Jan 02 2019
-
Magma
m:=30; R
:=PowerSeriesRing(Integers(), m); Coefficients(R!( (1-6*x+2*x^2)/(1-7*x+5*x^2-x^3) )); // G. C. Greubel, Jan 02 2019 -
Mathematica
q = x^3; s = x^2 + x + 1; z = 40; p[n_, x_] := (x^2 + x + 1)^n; 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}] (* A192806 *) u2 = Table[Coefficient[Part[t, n], x, 1], {n, 1, z}] (* A192807 *) u3 = Table[Coefficient[Part[t, n], x, 2], {n, 1, z}] (* A099464 *) LinearRecurrence[{7,-5,1}, {1,1,4}, 50] (* G. C. Greubel, Jan 02 2019 *)
-
PARI
{a(n) = polcoeff( lift( (1 + x + x^2)^n * Mod(1, x^3 - x^2 - x - 1)), 0)}; /* Michael Somos, Jun 17 2014 */
-
PARI
my(x='x+O('x^30)); Vec((1-6*x+2*x^2)/(1-7*x+5*x^2-x^3)) \\ G. C. Greubel, Jan 02 2019
-
Sage
((1-6*x+2*x^2)/(1-7*x+5*x^2-x^3)).series(x,20).coefficients(x, sparse=False) # G. C. Greubel, Jan 02 2019
Formula
G.f.: (1 - 6*x + 2*x^2)/(1 - 7*x + 5*x^2 - x^3). - R. J. Mathar, May 06 2014
a(n) = A000073(3n+2), n>0. - Bob Selcoe, Jun 10 2014
Extensions
Edited by N. J. A. Sloane, Jun 03 2018
Comments