A166106 a(n) = a(n-1) + a(n-2) + F(n), with a(0) = 0, a(1) = 1, a(2) = a(1) + a(0), a(3) = a(2) + a(1), a(4) = a(3) + a(2) + 2.
0, 1, 1, 2, 5, 12, 25, 50, 96, 180, 331, 600, 1075, 1908, 3360, 5878, 10225, 17700, 30509, 52390, 89664, 153000, 260375, 442032, 748775, 1265832, 2136000, 3598250, 6052061, 10164540, 17048641, 28559450, 47786400, 79870428, 133359715, 222457608, 370747675
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Harold Abelson and Gerald Jay Sussman with Julie Sussman, Tree Recursion from "Structure and Interpretation of Computer Programs", MIT Press, 1996, LaTeX2HTML translation by Ryan Bender.
- Laurent Bloch, Analyse de l'algorithme de Fibonacci
- Bill Wilson, The Prolog Dictionary - memoisation (shows Recursive call tree for Fibonacci number f_6).
- Index entries for linear recurrences with constant coefficients, signature (2,1,-2,-1).
Crossrefs
Cf. A000045.
Programs
-
Mathematica
a[n_] := a[n] = a[n-1] + a[n-2] + Fibonacci[n]; a[0] = 0; a[1] = 1; a[2] = 1; a[3] = 2; a[4] = 5; Table[a[n], {n, 0, 32}] (* Jean-François Alcover, Oct 03 2011 *)
-
PARI
s = 33; a = concat([0,1,1,2,5],vector(s-5)); for(n=6,s,a[n]=a[n-1]+a[n-2]+fibonacci(n)); for(n=1,s,print1(a[n],", "))
-
PARI
concat(0, Vec(x*(x^5+3*x^4+2*x^3-x^2-x+1)/(x^2+x-1)^2 + O(x^100))) \\ Colin Barker, May 25 2014
Formula
For n > 1, a(n) = A067331(n-2).
From Colin Barker, May 25 2014: (Start)
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3) - a(n-4) for n > 6.
G.f.: x*(x^5 + 3*x^4 + 2*x^3 - x^2 - x + 1) / (x^2+x-1)^2. (End)
a(n) = (1/25)*2^(-n-1)*(5*((1 - sqrt(5))^(n+1) + (1 + sqrt(5))^(n+1))*n - (25 + sqrt(5))*(1 + sqrt(5))^n + (sqrt(5) - 25)*(1 - sqrt(5))^n), n > 2. - Ilya Gutkovskiy, Apr 26 2016
Extensions
More terms from Colin Barker, May 25 2014
Comments