A193649 Q-residue of the (n+1)st Fibonacci polynomial, where Q is the triangular array (t(i,j)) given by t(i,j)=1. (See Comments.)
1, 1, 3, 5, 15, 33, 91, 221, 583, 1465, 3795, 9653, 24831, 63441, 162763, 416525, 1067575, 2733673, 7003971, 17938661, 45954543, 117709185, 301527355, 772364093, 1978473511
Offset: 0
Keywords
A192904 Constant term in the reduction by (x^2 -> x + 1) of the polynomial p(n,x) defined below at Comments.
1, 0, 1, 5, 16, 49, 153, 480, 1505, 4717, 14784, 46337, 145233, 455200, 1426721, 4471733, 14015632, 43928817, 137684905, 431542080, 1352570689, 4239325789, 13287204352, 41645725825, 130529073953, 409113752000, 1282274186177
Offset: 0
Comments
The titular polynomial is defined by p(n,x) = (x^2)*p(n-1,x) + x*p(n-2,x), with p(0,x) = 1, p(1,x) = x. The resulting sequence typifies a general class which we shall describe here. Suppose that u,v,a,b,c,d,e,f are numbers used to define these polynomials:
...
q(x) = x^2
s(x) = u*x + v
p(0,x) = a, p(1,x) = b*x + c
p(n,x) = d*(x^2)*p(n-1,x) + e*x*p(n-2,x) + f.
...
We shall assume that u is not 0 and that {d,e} is not {0}. The reduction of p(n,x) by the repeated substitution q(x) -> s(x), as defined and described at A192232 and A192744, has the form h(n) + k(n)*x. The numerical sequences h and k are linear recurrence sequences, formally of order 5. The Mathematica program below, with first line deleted, shows initial terms and recurrence coefficients, which imply these properties:
(1) the recurrence coefficients depend only on u,v,d,e; the parameters a,b,c,f affect only the initial terms.
(2) if e=0 or v=0, the order of recurrence is <= 3;
(3) if e=0 and v=0, the recurrence coefficients are 1+d*u^2 and -d*u^2 (cf. similar results at A192872).
...
Examples:
u v a b c d e f... seq h.....seq k
The terms of these sequences involve Fibonacci numbers, F(n)=A000045(n); e.g.,
A001906: even-indexed F(n)
A001519: odd-indexed F(n)
A103609: (1,1,1,1,2,2,3,3,5,5,8,8,...)
Examples
The first six polynomials and reductions: 1 -> 1 x -> x x + x^3 -> 1 + 3*x x^2 + x^3 + x^5 -> 5 + 8*x x^2 + 2*x^4 + x^5 + x^7 -> 16 + 25*x x^3 + 2*x^4 + 3*x^6 + x^7 + x^9 -> 49 + 79*x, so that A192904 = (1,0,1,5,16,49,...) and A192905 = (0,1,3,8,25,79,...)
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (3,0,1,1).
Programs
-
GAP
a:=[1,0,1,5];; for n in [5..40] do a[n]:=3*a[n-1]+a[n-3]+a[n-4]; od; a; # G. C. Greubel, Jan 10 2019
-
Magma
m:=40; R
:=PowerSeriesRing(Integers(), m); Coefficients(R!( (1-x)*(1-2*x-x^2)/(1-3*x-x^3-x^4) )); // G. C. Greubel, Jan 10 2019 -
Mathematica
(* To obtain general results, delete the next line. *) u = 1; v = 1; a = 1; b = 1; c = 0; d = 1; e = 1; f = 0; q = x^2; s = u*x + v; z = 24; p[0, x_] := a; p[1, x_] := b*x + c; p[n_, x_] := d*(x^2)*p[n - 1, x] + e*x*p[n - 2, x] + f; Table[Expand[p[n, x]], {n, 0, 8}] 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}]; u0 = Table[Coefficient[Part[t, n], x, 0], {n, 1, z}] (* A192904 *) u1 = Table[Coefficient[Part[t, n], x, 1], {n, 1, z}] (* A192905 *) Simplify[FindLinearRecurrence[u0]] (* recurrence for 0-sequence *) Simplify[FindLinearRecurrence[u1]] (* recurrence for 1-sequence *) LinearRecurrence[{3,0,1,1}, {1,0,1,5}, 40] (* G. C. Greubel, Jan 10 2019 *)
-
PARI
my(x='x+O('x^40)); Vec((1-x)*(1-2*x-x^2)/(1-3*x-x^3-x^4)) \\ G. C. Greubel, Jan 10 2019
-
Sage
((1-x)*(1-2*x-x^2)/(1-3*x-x^3-x^4)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Jan 10 2019
Formula
a(n) = 3*a(n-1) + a(n-3) + a(n-4).
G.f.: (1-x)*(1-2*x-x^2)/(1-3*x-x^3-x^4). - Colin Barker, Aug 31 2012
A192878 Constant term in the reduction by (x^2 -> x + 1) of the polynomial p(n,x) given in Comments.
3, 0, 4, 5, 18, 42, 115, 296, 780, 2037, 5338, 13970, 36579, 95760, 250708, 656357, 1718370, 4498746, 11777875, 30834872, 80726748, 211345365, 553309354, 1448582690, 3792438723, 9928733472, 25993761700, 68052551621, 178163893170, 466439127882, 1221153490483
Offset: 0
Comments
The polynomial p(n,x) is defined by p(0,x) = 1, p(1,x) = x + 1, and p(n,x) = x*p(n-1,x) + 2*(x^2)*p(n-1,x) + 1. See A192872.
For n>0, also the coefficient of x in the reduction x^2 -> x + 1 of the polynomial A000285(n-1)*x^(n-1). - R. J. Mathar, Jul 12 2011
Examples
The first six polynomials and reductions: p(0,x) = 3 -> 3 p(1,x) = x -> x p(2,x) = 4*x^2 -> 4 + 4*x p(3,x) = 5*x^3 -> 5 + 10*x p(4,x) = 9*x^4 -> 18 + 27*x p(5,x) = 14*x^5 -> 42 + 27*x In general, p(n,x) = A104449(n)*x^n -> A192878(n) + A192879(n)*x.
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,2,-1).
Programs
-
GAP
a:=[3,0,4];; for n in [4..30] do a[n]:=2*a[n-1]+2*a[n-2]-a[n-3]; od; a; # G. C. Greubel, Jan 08 2019
-
Magma
m:=30; R
:=PowerSeriesRing(Integers(), m); Coefficients(R!( (3-2*x^2-6*x)/((1+x)*(x^2-3*x+1)) )); // G. C. Greubel, Jan 08 2019 -
Mathematica
q = x^2; s = x + 1; z = 25; p[0, x_] := 3; 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}] (* A192878 *) u2 = Table[Coefficient[Part[t, n], x, 1], {n, 1, z}] (* A192879 *) FindLinearRecurrence[u1] FindLinearRecurrence[u2] LinearRecurrence[{2,2,-1}, {3,0,4}, 30] (* G. C. Greubel, Jan 08 2019 *)
-
PARI
a(n) = round((2^(-n)*(7*(-2)^n-(-4+sqrt(5))*(3+sqrt(5))^n+(3-sqrt(5))^n*(4+sqrt(5))))/5) \\ Colin Barker, Sep 29 2016
-
PARI
Vec((3-2*x^2-6*x)/((1+x)*(x^2-3*x+1)) + O(x^40)) \\ Colin Barker, Sep 29 2016
-
Sage
((3-2*x^2-6*x)/((1+x)*(x^2-3*x+1))).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Jan 08 2019
Formula
a(n) = 2*a(n-1) + 2*a(n-2) - a(n-3).
G.f.: ( 3 - 2*x^2 - 6*x ) / ( (1+x)*(1 - 3*x + x^2) ). - R. J. Mathar, May 07 2014
a(n) = (2^(-n)*(7*(-2)^n - (-4+sqrt(5))*(3+sqrt(5))^n + (3-sqrt(5))^n*(4+sqrt(5))))/5. - Colin Barker, Sep 29 2016
A192883 Constant term in the reduction by (x^2 -> x + 1) of the polynomial F(n+3)*x^n, where F = A000045 (Fibonacci sequence).
2, 0, 5, 8, 26, 63, 170, 440, 1157, 3024, 7922, 20735, 54290, 142128, 372101, 974168, 2550410, 6677055, 17480762, 45765224, 119814917, 313679520, 821223650, 2149991423, 5628750626, 14736260448, 38580030725, 101003831720, 264431464442, 692290561599
Offset: 0
Comments
See A192872.
a(n) is also the area of the triangle with vertices at (F(n),F(n+1)), (F(n+1),F(n)), and (F(n+3),F(n+4)) where F(n) = A000045(n). - J. M. Bergot, May 22 2014
Examples
G.f. = 2 + 5*x^2 + 8*x^3 + 26*x^4 + 63*x^5 + 170*x^6 + ... - _Michael Somos_, Mar 18 2022
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,2,-1).
Programs
-
GAP
a:=[2,0,5];; for n in [4..30] do a[n]:=2*a[n-1]+2*a[n-2]-a[n-3]; od; a; # G. C. Greubel, Jan 09 2019
-
Magma
m:=30; R
:=PowerSeriesRing(Integers(), m); Coefficients(R!( ( 2-4*x+x^2)/((1+x)*(1-3*x+x^2)) )); // G. C. Greubel, Jan 09 2019 -
Maple
with(combinat):seq(fibonacci(n-1)*fibonacci(n+3), n=0..27): # Gary Detlefs, Oct 19 2011
-
Mathematica
q = x^2; s = x + 1; z = 28; p[0, x_] := 2; p[1, x_] := 3 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}] (* A192883 *) u2 = Table[Coefficient[Part[t, n], x, 1], {n, 1, z}] (* minus A121646 *) LinearRecurrence[{2,2,-1}, {2,0,5}, 30] (* G. C. Greubel, Jan 09 2019 *) a[ n_] := Fibonacci[n+1]^2 + (-1)^n; (* Michael Somos, Mar 18 2022 *)
-
PARI
a(n) = round((2^(-1-n)*(7*(-1)^n*2^(1+n)+(3-sqrt(5))^(1+n)+(3+sqrt(5))^(1+n)))/5) \\ Colin Barker, Sep 29 2016
-
PARI
Vec((2+x^2-4*x)/((1+x)*(x^2-3*x+1)) + O(x^40)) \\ Colin Barker, Sep 29 2016
-
PARI
{a(n) = fibonacci(n+1)^2 + (-1)^n}; /* Michael Somos, Mar 18 2022 */
-
Sage
((2-4*x+x^2 )/((1+x)*(1-3*x+x^2))).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Jan 09 2019
Formula
a(n) = 2*a(n-1) + 2*a(n-2) - a(n-3).
a(n) = Fibonacci(n-1) * Fibonacci(n+3). - Gary Detlefs, Oct 19 2011
a(n) = Fibonacci(n+1)^2 + (-1)^n. - Gary Detlefs, Oct 19 2011
G.f.: ( 2-4*x+x^2 ) / ( (1+x)*(1-3*x+x^2) ). - R. J. Mathar, May 07 2014
a(n) = (2^(-1-n)*(7*(-1)^n*2^(1+n) + (3-sqrt(5))^(1+n) + (3+sqrt(5))^(1+n)))/5. - Colin Barker, Sep 29 2016
From Amiram Eldar, Oct 06 2020: (Start)
Sum_{n>=2} 1/a(n) = 7/18.
Sum_{n>=2} (-1)^n/a(n) = (4/phi - 13/6)/3, where phi is the golden ratio (A001622). (End)
a(n) = a(-2-n) for all n in Z. - Michael Somos, Mar 18 2022
A192914 Constant term in the reduction by (x^2 -> x + 1) of the polynomial C(n)*x^n, where C=A000285.
1, 0, 5, 9, 28, 69, 185, 480, 1261, 3297, 8636, 22605, 59185, 154944, 405653, 1062009, 2780380, 7279125, 19057001, 49891872, 130618621, 341963985, 895273340, 2343856029, 6136294753, 16065028224, 42058789925, 110111341545, 288275234716, 754714362597
Offset: 0
Comments
See A192872.
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,2,-1).
Programs
-
GAP
F:=Fibonacci; List([0..30], n -> F(n+1)^2 +F(n)*F(n-3)); # G. C. Greubel, Jan 12 2019
-
Magma
F:=Fibonacci; [F(n+1)^2+F(n)*F(n-3): n in [0..30]]; // Bruno Berselli, Feb 15 2017
-
Mathematica
q = x^2; s = x + 1; z = 28; p[0, x_]:= 1; p[1, x_]:= 4 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}] (* A192914 *) u2 = Table[Coefficient[Part[t, n], x, 1], {n, 1, z}] (* see A192878 *) LinearRecurrence[{2,2,-1}, {1,0,5}, 30] (* or *) With[{F:= Fibonacci}, Table[F[n+1]^2 +F[n]*F[n-3], {n, 0, 30}]] (* G. C. Greubel, Jan 12 2019 *)
-
PARI
a(n) = round((2^(-1-n)*(3*(-1)^n*2^(2+n)+(3+sqrt(5))^n*(-1+3*sqrt(5))-(3-sqrt(5))^n*(1+3*sqrt(5))))/5) \\ Colin Barker, Sep 29 2016
-
PARI
Vec((1+3*x^2-2*x)/((1+x)*(x^2-3*x+1)) + O(x^30)) \\ Colin Barker, Sep 29 2016
-
PARI
{f=fibonacci}; vector(30, n, n--; f(n+1)^2 +f(n)*f(n-3)) \\ G. C. Greubel, Jan 12 2019
-
Sage
f=fibonacci; [f(n+1)^2 +f(n)*f(n-3) for n in (0..30)] # G. C. Greubel, Jan 12 2019
Formula
a(n) = 2*a(n-1) + 2*a(n-2) - a(n-3).
G.f.: (1 + 3*x^2 - 2*x)/((1 + x)*(x^2 - 3*x + 1)). - R. J. Mathar, May 08 2014
a(n) = (2^(-1-n)*(3*(-1)^n*2^(2+n) + (3 + sqrt(5))^n*(-1 + 3*sqrt(5)) - (3-sqrt(5))^n*(1 + 3*sqrt(5))))/5. - Colin Barker, Sep 29 2016
a(n) = F(n+1)^2 + F(n)*F(n-3). - Bruno Berselli, Feb 15 2017
A066182 Permutation of the integers with cycle form {1}, {3, 2}, {6, 5, 4}, {10, 9, 8, 7}, ...
1, 3, 2, 6, 4, 5, 10, 7, 8, 9, 15, 11, 12, 13, 14, 21, 16, 17, 18, 19, 20, 28, 22, 23, 24, 25, 26, 27, 36, 29, 30, 31, 32, 33, 34, 35, 45, 37, 38, 39, 40, 41, 42, 43, 44, 55, 46, 47, 48, 49, 50, 51, 52, 53, 54, 66, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 78, 67, 68, 69, 70, 71
Offset: 1
Comments
Arrange natural numbers 1,2,3,4,5,... as a triangle like A000027, then rotate each row of triangle one step right. - Antti Karttunen, May 07 2002
As a rectangular array, a(n) is the natural interspersion of the sequence of triangular numbers; see A192872. [Clark Kimberling, Aug 12 2011]
Examples
Northwest corner, when sequence is formatted as the natural interspersion of the sequence (1,3,6,10,15,...) of triangular numbers: 1...3...6...10...15 2...4...7...11...16 5...8...12..17...23 9...13..18..24...31 [ _Clark Kimberling_, Aug 12 2011 ]
Links
Programs
-
Mathematica
FromCycles[Table[n(n-1)/2+Range[n, 1, -1], {n, 13}]]
-
Python
from math import isqrt, comb def A066182(n): return -1+n+comb(isqrt(n<<3)+3>>1,2)-comb(isqrt(n-1<<3)+3>>1,2) # Chai Wah Wu, Jun 09 2025
Formula
a(n) = -1+n+binomial(A002024(n)+1,2)-binomial(A002024(n-1)+1,2) where A002024(n) is round(sqrt(2*n)). - Brian Tenneson, Feb 03 2017
A192879 Coefficient of x in the reduction by (x^2 -> x + 1) of the polynomial p(n,x) given in Comments.
0, 1, 4, 10, 27, 70, 184, 481, 1260, 3298, 8635, 22606, 59184, 154945, 405652, 1062010, 2780379, 7279126, 19057000, 49891873, 130618620, 341963986, 895273339, 2343856030, 6136294752, 16065028225, 42058789924, 110111341546, 288275234715, 754714362598
Offset: 0
Comments
The polynomial p(n,x) is defined by p(0,x) = 1, p(1,x) = x+1, and p(n,x) = x*p(n-1,x) + 2*(x^2)*p(n-1,x) + 1. See A192872.
A192879 is also generated as the coefficient sequence of x in the reduction x^2->x+1 of the polynomial v(n,x) defined by v(0,x) = 2, v(1,x) = x+1, and v(n,x) = x*v(n-1,x) + 2*(x^2)*v(n-1,x) + 1, for n>0, v(n,x) = F(n)*x^(n-1) + L(n)*x^n, where F(n) = A000045(n) (Fibonacci numbers) and L(n) = A000032(n) (Lucas numbers).
Examples
The first six polynomials and reductions: p(0,x) = 3 -> 3 p(1,x) = x -> x p(2,x) = 4*x^2 -> 4+4*x p(3,x) = 5*x^3 -> 5+10*x p(4,x) = 9*x^4 -> 18+27*x p(5,x) = 14*x^5 -> 42+27*x In general, p(n,x) = (A104449(n))*x^n -> A192878(n) + A192879(n)*x.
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,2,-1).
Programs
-
GAP
a:=[0,1,4];; for n in [4..40] do a[n]:=2*a[n-1]+2*a[n-2]-a[n-3]; od; a; # G. C. Greubel, Jan 07 2019
-
Magma
I:=[0,1,4]; [n le 3 select I[n] else 2*Self(n-1) +2*Self(n-2) -Self(n-3): n in [1..40]]; // G. C. Greubel, Jan 07 2019
-
Maple
with(combinat); seq( fibonacci(2*n) + fibonacci(n)*fibonacci(n-1), n=0..40); # G. C. Greubel, Feb 13 2020
-
Mathematica
(See A192878.) LinearRecurrence[{2,2,-1}, {0,1,4}, 30] (* G. C. Greubel, Jan 07 2019 *) a[n_] := a[n] = 2*a[n-1]+2*a[n - 2]-a[n-3]; a[0] = 0; a[1]=1; a[2]=4; Table[a[n], {n,0,40}] (* Rigoberto Florez, Feb 06 2020 *) Table[Fibonacci[n]*Fibonacci[n-1]+Fibonacci[2n], {n,0,40}] (* Rigoberto Florez, Feb 06 2020 *)
-
PARI
a(n) = round((2^(-1-n)*((-1)^n*2^(1+n)+(3+sqrt(5))^n*(-1+3*sqrt(5))-(3-sqrt(5))^n*(1+3*sqrt(5))))/5) \\ Colin Barker, Sep 29 2016
-
PARI
concat(0, Vec(x*(1+2*x)/((1+x)*(1-3*x+x^2)) + O(x^40))) \\ Colin Barker, Sep 29 2016
-
Sage
(x*(1+2*x)/((1+x)*(1-3*x+x^2))).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Jan 07 2019
Formula
a(n) = 2*a(n-1) + 2*a(n-2) - a(n-3), with a(0) = 0, a(1) = 1, a(2) = 4.
G.f.: x * (1+2*x) / ((1+x) * (1-3*x+x^2)). - Colin Barker, Jun 18 2012
a(n) = (2^(-1-n) * ((-1)^n*2^(1+n) + (3+sqrt(5))^n * (-1+3*sqrt(5)) - (3-sqrt(5))^n * (1+3*sqrt(5))))/5. - Colin Barker, Sep 29 2016
a(n) = F(n-1)*F(n) + F(2n), where F(n) is a Fibonacci number. - Rigoberto Florez, Feb 06 2020
E.g.f.: (exp(-x) + exp(3*x/2) * (3*sqrt(5)*sinh(sqrt(5)*x/2) - cosh(sqrt(5)*x/2)))/5. - Stefano Spezia, Feb 06 2020
a(n)*F(n) = the number of ways to tile a 3-arm starfish (with n-1 cells on each arm and one cell in the center) using squares and dominos. - Greg Dresden and Hasita Kanamarlapudi, Oct 02 2023
A192873 Coefficient of x in the reduction by (x^2->x+1) of the polynomial p(n,x) given in Comments.
0, 1, 2, 7, 18, 49, 128, 337, 882, 2311, 6050, 15841, 41472, 108577, 284258, 744199, 1948338, 5100817, 13354112, 34961521, 91530450, 239629831, 627359042, 1642447297, 4299982848, 11257501249, 29472520898, 77160061447, 202007663442, 528862928881, 1384581123200
Offset: 0
Comments
The polynomial p(n,x) is defined by p(0,x) = 1, p(1,x) = x, and p(n,x) = x*p(n-1,x) + (x^2)*p(n-1,x) + 1. See A192872.
First differences give A236428. - Richard R. Forberg, Feb 23 2014
Examples
The coefficients of all the polynomials p(n,x) are Fibonacci numbers (A000045). The first 6 and their reductions: p(0,x) = 1 -> 1 p(1,x) = x -> x p(2,x) = 1 +2*x^2 -> 3 +2*x p(3,x) = 1 +x +3*x^3 -> 4 +7*x p(4,x) = 1 +x +2*x^2 +5*x^4 -> 13 +18*x p(5,x) = 1 +x +2*x^2 +3*x^3 +8*x^5 -> 30 +49*x G.f. = x + 2*x^2 + 7*x^3 + 18*x^4 + 49*x^5 + 128*x^6 + 337*x^7 + ...
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (3,0,-3,1).
Programs
-
GAP
a:=[0,1,2,7];; for n in [5..40] do a[n]:=3*a[n-1]-3*a[n-3]+a[n-4]; od; a; # G. C. Greubel, Jan 07 2019
-
Magma
I:=[0,1,2,7]; [n le 4 select I[n] else 3*Self(n-1) - 3*Self(n-3) +Self(n-4): n in [1..40]]; // G. C. Greubel, Jan 07 2019
-
Maple
seq(coeff(series(x*(x^2-x+1)/((1-x)*(1+x)*(x^2-3*x+1)),x,n+1), x, n), n = 0 .. 35); # Muniru A Asiru, Jan 08 2019
-
Mathematica
(See A192872.) a[ n_] := SeriesCoefficient[ x * (1 - x + x^2) / ((1 - x^2) * (1 - 3*x + x^2)), {x, 0, Abs @ n}]; (* Michael Somos, Apr 08 2014 *) LinearRecurrence[{3,0,-3,1}, {0,1,2,7}, 40] (* G. C. Greubel, Jan 07 2019 *)
-
PARI
concat(0, Vec(-x*(x^2-x+1)/((x-1)*(x+1)*(x^2-3*x+1)) + O(x^40))) \\ Colin Barker, Apr 01 2014
-
Sage
(x*(x^2-x+1)/((1-x^2)*(x^2-3*x+1))).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Jan 07 2019
Formula
a(n) = 3*a(n-1) - 3*a(n-3) + a(n-4).
G.f.: x*(x^2-x+1) / ((1-x)*(1+x)*(x^2-3*x+1)). - Colin Barker, Apr 01 2014
a(n) = (1/10) * (4L(2*n) - 3*(-1)^n - 5), with L(n) the Lucas numbers (A000032). - Ralf Stephan, Apr 06 2014
a(-n) = a(n) for all n in Z. - Michael Somos, Apr 08 2014
Extensions
More terms from Colin Barker, Apr 01 2014
A192874 Constant term in the reduction by (x^2 -> x + 1) of the polynomial p(n,x) given in Comments.
1, 0, 4, 6, 26, 72, 246, 774, 2532, 8150, 26434, 85448, 276654, 895054, 2896788, 9373678, 30334682, 98163784, 317666758, 1027987894, 3326644036, 10765237670, 34837054674, 112735054856, 364818336766, 1180576879422
Offset: 0
Keywords
Comments
The polynomial p(n,x) is defined by p(0,x) = 1, p(1,x) = x, and p(n,x) = x*p(n-1,x) + 2*(x^2)*p(n-1,x) + 1. See A192872.
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,6,-5,-6,4).
Programs
-
GAP
a:=[1,0,4,6,26];; for n in [6..30] do a[n]:=2*a[n-1]+6*a[n-2] - 5*a[n-3]-6*a[n-4]+4*a[n-5]; od; a; # G. C. Greubel, Jan 08 2019
-
Magma
I:=[1,0,4,6,26]; [n le 5 select I[n] else 2*Self(n-1)+6*Self(n-2) -5*Self(n-3)-6*Self(n-4)+4*Self(n-5): n in [1..30]]; // G. C. Greubel, Jan 08 2019
-
Mathematica
q = x^2; s = x + 1; z = 26; p[0, x_] := 1; p[1, x_] := x; p[n_, x_] := p[n - 1, x]*x + 2*p[n - 2, x]*x^2 + 1; 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}] (* A192874 *) u2 = Table[Coefficient[Part[t, n], x, 1], {n, 1, z}] (* A192875 *) LinearRecurrence[{2,6,-5,-6,4}, {1,0,4,6,26}, 30] (* G. C. Greubel, Jan 08 2019 *)
-
PARI
my(x='x+O('x^30)); Vec((x^2-x+1)*(4*x^2+x-1)/((x-1)*(x^2-x-1)*( 4*x^2+2*x-1))) \\ G. C. Greubel, Jan 08 2019
-
Sage
((x^2-x+1)*(4*x^2+x-1)/((x-1)*(x^2-x-1)*( 4*x^2+2*x-1))).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Jan 08 2019
Formula
a(n) = 2*a(n-1) + 6*a(n-2) - 5*a(n-3) - 6*a(n-4) + 4*a(n-5).
G.f.: (x^2-x+1)*(4*x^2+x-1) / ( (x-1)*(x^2-x-1)*(4*x^2+2*x-1) ). - R. J. Mathar, May 06 2014
A192875 Coefficient of x in the reduction by (x^2 -> x + 1) of the polynomial p(n,x) given in Comments.
0, 1, 3, 11, 37, 119, 391, 1257, 4087, 13195, 42757, 138271, 447615, 1448249, 4687071, 15166963, 49082501, 158832391, 513995543, 1663319433, 5382623015, 17418520571, 56367538373, 182409150671, 590288468367, 1910213517529
Offset: 0
Keywords
Comments
The polynomial p(n,x) is defined by p(0,x) = 1, p(1,x) = x, and p(n,x) = x*p(n-1,x) + 2*(x^2)*p(n-1,x) + 1. See A192872.
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,6,-5,-6,4).
Programs
-
GAP
a:=[0,1,3,11,37];; for n in [6..30] do a[n]:=2*a[n-1]+6*a[n-2] - 5*a[n-3]-6*a[n-4]+4*a[n-5]; od; a; # G. C. Greubel, Jan 08 2019
-
Magma
m:=30; R
:=PowerSeriesRing(Integers(), m); [0] cat Coefficients(R!( x*(1+2*x)*(1-x+x^2)/((1-x)*(1+ x-x^2)*(1-2*x-4*x^2)) )); // G. C. Greubel, Jan 08 2019 -
Maple
seq(coeff(series(x*(1+2*x)*(1-x+x^2)/((1-x)*(1+x-x^2)*(1-2*x-4*x^2)),x,n+1), x, n), n = 0 .. 30); # Muniru A Asiru, Jan 08 2019
-
Mathematica
(See A192874.) LinearRecurrence[{2,6,-5,-6,4}, {0,1,3,11,37}, 30] (* G. C. Greubel, Jan 08 2019 *)
-
PARI
my(x='x+O('x^30)); concat([0], Vec(x*(1+2*x)*(1-x+x^2)/((1-x)*(1+ x-x^2)*(1-2*x-4*x^2)))) \\ G. C. Greubel, Jan 08 2019
-
Sage
(x*(1+2*x)*(1-x+x^2)/((1-x)*(1+ x-x^2)*(1-2*x-4*x^2))).series(x, 20).coefficients(x, sparse=False) # G. C. Greubel, Jan 08 2019
Formula
a(n) = 2*a(n-1) + 6*a(n-2) - 5*a(n-3) - 6*a(n-4) + 4*a(n-5).
G.f.: x*(1+2*x)*(1-x+x^2) / ( (1-x)*(1+x-x^2)*(1-2*x-4*x^2)). - R. J. Mathar, May 06 2014
Comments
Examples
Crossrefs
Programs
Mathematica
Formula