OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3, -2, -1, 1).
FORMULA
a(n) = A023537(n) + 2*n.
From Colin Barker, Mar 11 2017: (Start)
G.f.: x*(2-x)*(1+x) / ((1-x)^2*(1-x-x^2)).
a(n) = (2^(-1-n)*((1-sqrt(5))^n*(-15+7*sqrt(5)) + (1+sqrt(5))^n*(15+7*sqrt(5)))) / sqrt(5) - 2*n - 7.
a(n) = 3*a(n-1) - 2*a(n-2) - a(n-3) + a(n-4) for n>4.
(End)
a(n) = Lucas(n+4) - 2*n - 7. - G. C. Greubel, Jun 01 2019
MATHEMATICA
LinearRecurrence[{3, -2, -1, 1}, {2, 7, 16, 32}, 40] (* Vladimir Joseph Stephan Orlovsky, Feb 11 2012 *)
PROG
(PARI) Vec(x*(2-x)*(1+x)/((1-x)^2*(1-x-x^2)) + O(x^40)) \\ Colin Barker, Mar 11 2017
(PARI) vector(40, n, fibonacci(n+5) + fibonacci(n+3) -2*n-7) \\ G. C. Greubel, Jun 01 2019
(Magma) [Lucas(n+4) - 2*n - 7 : n in [1..40]]; // G. C. Greubel, Jun 01 2019
(Sage) [lucas_number2(n+4, 1, -1) -2*n-7 for n in (1..40)] # G. C. Greubel, Jun 01 2019
(GAP) List([1..40], n-> Lucas(1, -1, n+4)[2] -2*n-7 ); # G. C. Greubel, Jun 01 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved