OFFSET
0,2
COMMENTS
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,2,-1).
FORMULA
a(n) = 2*a(n-1) + 2*a(n-2) - a(n-3).
G.f.: (1-2*x)*(1+2*x) / ( (1+x)*(1-3*x+x^2) ). - R. J. Mathar, May 08 2014
a(n) = F(n-4)*F(n) + F(n-1)*F(n+2), where F(-4)=-3, F(-3)=2, F(-2)=-1, F(-1)=1. - Bruno Berselli, Nov 03 2015
a(n) = (2^(-n)*(-3*(-2)^n-(-4+sqrt(5))*(3+sqrt(5))^n+(3-sqrt(5))^n*(4+sqrt(5))))/5. - Colin Barker, Oct 01 2016
EXAMPLE
The coefficients in the polynomials p(n,x) are Fibonacci numbers. The first seven and their reductions:
...
1 -> 1
1 + x^2 -> 2 + x
x + x^2 + x^3 -> 2 + 4*x
2*x^2 + x^3 + 2*x^4 -> 7 + 10*x
3*x^3 + 2*x^4 + 3*x^5 -> 16 + 27*x
5*x^4 + 3*x^5 + 5*x^6 -> 44 + 70*x
8*x^5 + 5*x^6 + 8*x^7 -> 113 + 184*x,
so that A192921=(1,2,2,7,16,44,113,...).
MAPLE
a:= n-> (<<0|1|0>, <0|0|1>, <-1|2|2>>^n. <<1, 2, 2>>)[1, 1]:
seq(a(n), n=0..30); # Alois P. Heinz, Sep 28 2016
MATHEMATICA
q = x^2; s = x + 1; z = 28;
p[0, x_] := 1; p[1, x_] := x^2 + 1;
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}]
(* A192921 *)
u2 = Table[Coefficient[Part[t, n], x, 1], {n, 1, z}]
(* A192879 *)
LinearRecurrence[{2, 2, -1}, {1, 2, 2}, 30] (* G. C. Greubel, Feb 06 2019 *)
PROG
(PARI) a(n) = round((2^(-n)*(-3*(-2)^n-(-4+sqrt(5))*(3+sqrt(5))^n+(3-sqrt(5))^n*(4+sqrt(5))))/5) \\ Colin Barker, Oct 01 2016
(PARI) Vec(-(2*x-1)*(1+2*x)/((1+x)*(x^2-3*x+1)) + O(x^40)) \\ Colin Barker, Oct 01 2016
(PARI) {a(n) = fibonacci(n-2)^2 +fibonacci(n)*fibonacci(n+1)}; \\ G. C. Greubel, Feb 06 2019
(Magma) [Fibonacci(n-2)^2 + Fibonacci(n)*Fibonacci(n+1): n in [0..30]]; // G. C. Greubel, Feb 06 2019
(Sage) [fibonacci(n-2)^2 +fibonacci(n)*fibonacci(n+1) for n in range(30)] # G. C. Greubel, Feb 06 2019
(GAP) List([0..30], n -> Fibonacci(n-2)^2 +Fibonacci(n)*Fibonacci(n+1)); # G. C. Greubel, Feb 06 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jul 12 2011
STATUS
approved