OFFSET
1,1
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3,-2,-1,1).
FORMULA
G.f.: x*(3-2*x)/((1-x-x^2)*(1-x)^2). - Ralf Stephan, Apr 28 2004
From Colin Barker, Mar 11 2017: (Start)
a(n) = 3*a(n-1) - 2*a(n-2) - a(n-3) + a(n-4) for n>4.
a(n) = -5 + (2^(-1-n)*((1-sqrt(5))^n*(-13+5*sqrt(5)) + (1+sqrt(5))^n*(13+5*sqrt(5)))) / sqrt(5) - n. (End)
a(n) = Fibonacci(n+4) + 2*Fibonacci(n+2) - (n+5). - G. C. Greubel, Jul 08 2019
MATHEMATICA
LinearRecurrence[{3, -2, -1, 1}, {3, 7, 15, 28}, 40] (* or *) Rest[ CoefficientList[Series[(x(3-2x))/((1-x-x^2)(1-x)^2), {x, 0, 40}], x]] (* Harvey P. Dale, Apr 24 2011 *)
With[{F=Fibonacci}, Table[F[n+4]+2*F[n+2]-n-5, {n, 40}]] (* G. C. Greubel, Jul 08 2019 *)
PROG
(PARI) Vec(x*(3-2*x)/((1-x-x^2)*(1-x)^2) + O(x^40)) \\ Colin Barker, Mar 11 2017
(PARI) vector(40, n, f=fibonacci; f(n+4)+2*f(n+2)-n-5) \\ G. C. Greubel, Jul 08 2019
(Magma) F:=Fibonacci; [F(n+4)+2*F(n+2)-n-5: n in [1..40]]; // G. C. Greubel, Jul 08 2019
(Sage) f=fibonacci; [f(n+4)+2*f(n+2)-n-5 for n in (1..40)] # G. C. Greubel, Jul 08 2019
(GAP) F:=Fibonacci;; List([1..40], n-> F(n+4)+2*F(n+2)-n-5) # G. C. Greubel, Jul 08 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved