login
A161762
Sum of all numbers from and including Fibonacci(n-1) to and including Fibonacci(n).
2
1, 1, 3, 5, 12, 26, 63, 153, 385, 979, 2520, 6524, 16965, 44225, 115479, 301833, 789412, 2065414, 5405235, 14147705, 37033701, 96946631, 253795248, 664421400, 1739440297, 4553853121, 11922044043, 31212157613, 81714232380, 213930221714
OFFSET
1,3
FORMULA
From G. C. Greubel, Oct 24 2018: (Start)
a(n) = 3*a(n-1) + a(n-2) - 5*a(n-3) - a(n-4) + a(n-5).
G.f.: x*(1 - 2*x - x^2)/(1 - 3*x - x^2 + 5*x^3 + x^4 - x^5). (End)
a(n) = (Lucas(2*n - 1) + 5*Fibonacci(n + 1) - 4*(-1)^n)/10. - Greg Dresden, Jan 01 2021
EXAMPLE
Fibonacci(0) to Fibonacci(10) are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55. Hence a(1) = 0+1 = 1, a(2) = 1, a(3) = 1+2 = 3, a(6) = 5+6+7+8 = 26, a(8) = 13+14+15+16+17+18+19+20+21 = 153.
MATHEMATICA
Table[Sum[k, {k, Fibonacci[n - 1], Fibonacci[n]}], {n, 1, 50}] (* or *) LinearRecurrence[{3, 1, -5, -1, 1}, {1, 1, 3, 5, 12}, 50] (* G. C. Greubel, Oct 24 2018 *)
Total[Range[#[[1]], #[[2]]]]&/@Partition[Fibonacci[Range[0, 30]], 2, 1] (* Harvey P. Dale, Feb 13 2023 *)
PROG
(Magma) [&+[Fibonacci(n-1)..Fibonacci(n)]: n in [1..30]]; // Klaus Brockhaus, Jun 25 2009
(Magma) m:=50; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(x*(1-2*x-x^2)/(1-3*x-x^2+5*x^3+x^4-x^5))); // G. C. Greubel, Oct 24 2018
(PARI) for(n=1, 50, print1(sum(k=fibonacci(n-1), fibonacci(n), k), ", ")) \\ G. C. Greubel, Oct 24 2018
CROSSREFS
Cf. A000045 (Fibonacci numbers), A000032 (Lucas numbers).
Sequence in context: A280000 A241097 A267725 * A245649 A291035 A005913
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Edited, corrected (a(2)=2 replaced by 1, a(13)=15310 replaced by 16965) and extended beyond a(13) by Klaus Brockhaus, Jun 25 2009
Definition clarified by Harvey P. Dale, Feb 13 2023
STATUS
approved