OFFSET
1,2
COMMENTS
See A265762 for a guide to related sequences.
LINKS
Colin Barker, Table of n, a(n) for n = 1..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.: x*(1 - 25*x - x^2 + 2*x^3) / ((1 + x)*(1 - 3*x + x^2)).
a(n) = (1/5)*2^(-n)*(-23*(-2)^n + (4-8*sqrt(5)) * (3+sqrt(5))^n + (3-sqrt(5))^n*(4+8*sqrt(5))) for n>1. - Colin Barker, May 21 2020
a(n) = 3*a(n-1) - a(n-2) - 23*(-1)^n for n >= 4. - Greg Dresden, May 18 2020
EXAMPLE
Let p(n,x) be the minimal polynomial of the number given by the n-th continued fraction:
[sqrt(5),1,1,1,1,...] = (-1+3*sqrt(5))/2 has p(0,x)=-11+x+x^2, so a(0) = 1;
[1,sqrt(5),1,1,1,...] = (23+3*sqrt(5))/22 has p(1,x)=11-23x+11x^2, so a(1) = 11;
[1,1,sqrt(5),1,1,...] = (45-3* sqrt(5))/22 has p(2,x)=45-45x+11x^2, so a(2) = 11.
MATHEMATICA
u[n_] := Table[1, {k, 1, n}]; t[n_] := Join[u[n], {Sqrt[5]}, {{1}}];
f[n_] := FromContinuedFraction[t[n]];
t = Table[MinimalPolynomial[f[n], x], {n, 0, 20}]
Coefficient[t, x, 0] (* A266705 *)
Coefficient[t, x, 1] (* A266706 *)
Coefficient[t, x, 2] (* A266705 *)
LinearRecurrence[{2, 2, -1}, {1, -23, -45, -135}, 40] (* Harvey P. Dale, Jul 30 2017 *)
PROG
(PARI) Vec(x*(1-25*x-x^2+2*x^3)/((1+x)*(1-3*x+x^2)) + O(x^30)) \\ Colin Barker, Sep 29 2016
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Clark Kimberling, Jan 09 2016
STATUS
approved