 Why isn't Fibonacci of 3 = 3 since (3-1) + (3-2) =2 | SoloLearn: Learn to code for FREE!

+3

# Why isn't Fibonacci of 3 = 3 since (3-1) + (3-2) =2

+3

You count terms. Fib(3) is the fibonacci of 3d term which is 2 but if you say before number 3 which are 2+1 then its 3. when you say fib(3) you have to define what you mean 3d term of sequence which is the number 2 or you mean the number 3 which is the 4th term

+3

Maybe the confusion comes from some people starting the sequence at 0 and others starting it at 1?

+3

Sonic Kondwani Mwape There is confusion because some people make a fibo sequence that the first number of it is 1, some of them make the first number 0. It is true that fibonacci starts from 0 and 0 is the first number of the sequence, not 1. That is why in a pseudo-code, the recursion of fibonacci function have a base if n is 0, return 0, else if n is 1 return 1, other than that you do recursive. What made the confusion is also that when you do fibo (1) for example, it prints out 1 instead of 0, why is that? Because in programming (what I know), is that things starts from 0 like indexes of arrays, you can make your own code looks like if you input 1, it does fibo(input-1) and it will print out 0 instead of 1. I hope this is clear to understand.

+3

LastSecond959 well said.

+2

if the fibonacci sequence is defined to start at 0, then the sequence is 0,1,1,2,3,5,8,...then fib(0)=0, fib(1)=1, fib(2)=1, fib(3)=2, and fib(4)=3. it all depends on where you start the sequence, if started a 1, instead of 0, then fib(3)=3

+1

(3-1)+(3-2)=3, you wrote it wrong.

+1

Repost your question. Its unclear and wrong.

+1

I was asking why Fibonacci of 3 isnt equal to 3

+1

Bcz fib sequence starts from zero, and starts counting every 3 numbers. Like 0,1,1,2,3, 5,...

+1

Sorry could you be a little bit more elaborate

+1

Bro, fib(3) = 2+1. fib of number 3, not fib of 3d term

+1

With 3 i mean the number not the term... 0 is the 0 term. 1 is the 1st term 1 is the 2nd term 2 is the 3d term so fib(3d)=2 BUT fib(number 3) =3

+1

Which is 3 right? But its supposed to be 2

0

Because (3-1)+(3-2)= 3

0

hOw can i got points plz tell me LastSecond959 I DONT KNO WHO ARE U BUT HELP ME

0

Krishna Saxena Umm, what points?