How would I solve this part of the Fibonacci sequence piecewise function?
f(n) = f(n-1)+f(n-2) if n > 1. Thanks
6 answers
n = 4
What do you mean solve it ?
f(0) = 1
f(1) = 1
f(2) = 2
f(3) = 1+2 = 3
f(4) = 2+3 = 5
f(5) = 3+5 = 8
f(6) = 5+8 = 13
f(7) = 8+13 = 21
f(0) = 1
f(1) = 1
f(2) = 2
f(3) = 1+2 = 3
f(4) = 2+3 = 5
f(5) = 3+5 = 8
f(6) = 5+8 = 13
f(7) = 8+13 = 21
and on and on
Google Fibonacci Sequence
Google Fibonacci Sequence
I'm being asked to solve f(4) = f(4-1) + f(4-2). The answers is 3, but I don't know how to get to that answer. Thanks
f(4) = f(3)+f(2) = 3 + 2 = 5
as I showed you above.
as I showed you above.
The answer is not 3 but 5