OFFSET
-1,1
LINKS
Colin Barker, Table of n, a(n) for n = -1..1000
J. L. Diaz-Barrero, Problem B-1029, Fib. Quart., 45 (2007), 86.
Index entries for linear recurrences with constant coefficients, signature (5,5,-1).
FORMULA
From Colin Barker, May 11 2012: (Start)
a(n) = 5*a(n-1) + 5*a(n-2) - a(n-3).
G.f.: 2*x^-1*(1-x-4*x^2)/((1+x)*(1-6*x+x^2)). (End)
a(n) = (2*(-1)^n+5*(3-2*sqrt(2))^(1+n)+5*(3+2*sqrt(2))^(1+n))/4 for n>=0. - Colin Barker, Nov 04 2016
MATHEMATICA
LinearRecurrence[{5, 5, -1}, {2, 8, 42}, 50] (* G. C. Greubel, Sep 27 2018 *)
PROG
(PARI) Vec(2*x^-1*(1-x-4*x^2)/((1+x)*(1-6*x+x^2)) + O(x^30)) \\ Colin Barker, Nov 04 2016
(Magma) I:=[2, 8, 42]; [n le 3 select I[n] else 5*Self(n-1) + 5*Self(n-2) - Self(n-3): n in [1..30]]; // G. C. Greubel, Sep 27 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Nov 27 2007
STATUS
approved