OFFSET
0,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,0,-1)
FORMULA
From R. J. Mathar, Mar 11 2011: (Start)
a(n+1) - a(n) = A022382(n-1).
G.f.: ( 3+3*x-5*x^2 ) / ( (x-1)*(x^2+x-1) ). (End)
a(n) = 2*Lucas(n+1) + 2*Fibonacci(n+2) - 1. - Greg Dresden, Oct 10 2020
MATHEMATICA
CoefficientList[Series[(3+3*x-5*x^2)/((x-1)*(x^2+x-1)), {x, 0, 50}], x] (* or *) LinearRecurrence[{2, 0, -1}, {3, 9, 13}, 50] (* G. C. Greubel, Mar 01 2018 *)
nxt[{a_, b_}]:={b, a+b+1}; NestList[nxt, {3, 9}, 40][[;; , 1]] (* Harvey P. Dale, Sep 13 2024 *)
PROG
(PARI) x='x+O('x^40); Vec((3+3*x-5*x^2)/((x-1)*(x^2+x-1))) \\ G. C. Greubel, Mar 01 2018
(Magma) I:=[3, 9, 13]; [n le 3 select I[n] else 2*Self(n-1) - Self(n-3): n in [1..40]]; // G. C. Greubel, Mar 01 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Terms a(31) onward added by G. C. Greubel, Mar 01 2018
STATUS
approved