OFFSET
1,1
LINKS
G. C. Greubel, 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) = L(1)*(F(n+1) - 1) + L(0)*F(n) - L(-1)*n, F(n): Fibonacci (A000045), L(n): Lucas (A000032) with L(-n) = (-1)^n*L(n).
G.f.: x*(3-4*x)/((1-x-x^2)*(1-x)^2).
a(n) = Lucas(n+1) + n - 1. - G. C. Greubel, Jun 01 2019
MATHEMATICA
LinearRecurrence[{3, -2, -1, 1}, {3, 5, 9, 14}, 50] (* Vladimir Joseph Stephan Orlovsky, Jan 28 2011, modified by G. C. Greubel, Jun 01 2019 *)
Table[LucasL[n+1] +n-1, {n, 1, 50}] (* G. C. Greubel, Jun 01 2019 *)
PROG
(PARI) {a(n) = fibonacci(n+2) + fibonacci(n) + n-1}; \\ G. C. Greubel, Jun 01 2019
(Magma) [Lucas(n+1) +n-1: n in [1..50]]; // G. C. Greubel, Jun 01 2019
(Sage) [lucas_number2(n+1, 1, -1) +n-1 for n in (1..50)] # G. C. Greubel, Jun 01 2019
(GAP) List([1..50], n-> Lucas(1, -1, n+1)[2] +n-1) # G. C. Greubel, Jun 01 2019
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
EXTENSIONS
Terms a(31) onward added by G. C. Greubel, Jun 01 2019
STATUS
approved