OFFSET
1,2
COMMENTS
a(n)/a(n-1) tends to 1 + sqrt(2).
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (4,-4,0,1).
FORMULA
From Colin Barker, Sep 02 2019: (Start)
G.f.: x*(1 - x + x^2 + x^3) / ((1 - x)^2*(1 - 2*x - x^2)).
a(n) = (-(1 - sqrt(2))^(1+n) + (1+sqrt(2))^(1+n)) / (2*sqrt(2)) - n.
a(n) = 4*a(n-1) - 4*a(n-2) + a(n-4) for n>4. (End)
E.g.f.: exp(x)*(cosh(sqrt(2)*x) + sinh(sqrt(2)*x)/sqrt(2) - x) - 1. - Stefano Spezia, Feb 01 2025
EXAMPLE
MATHEMATICA
LinearRecurrence[{4, -4, 0, 1}, {1, 3, 9, 25}, 30] (* James C. McMahon, Feb 01 2025 *)
PROG
(PARI) Vec(x*(1 - x + x^2 + x^3) / ((1 - x)^2*(1 - 2*x - x^2)) + O(x^35)) \\ Colin Barker, Sep 02 2019
CROSSREFS
KEYWORD
nonn,easy,changed
AUTHOR
Gary W. Adamson, Sep 19 2007
STATUS
approved