11 Comments
User's avatar
Tobi Akinpelu's avatar

Edited: Val silverCoins = {0, 1, 1, 2, 3, 5} the Fibonacci at p5, is 6 (2+3)

Correction: Val silverCoins = {0, 1, 1, 2, 3, 5} the Fibonacci at p7, is 8 (5+3)

Expand full comment
Taiwo Esther's avatar

I am super excited to be honest, thanks for considering my comment, I truly appreciate sir

God bless you!

Expand full comment
Tobi Akinpelu's avatar

You’re most welcome, Taiwo.

Expand full comment
Dapo Michael's avatar

Wow

I am super excited because, being so lucky is not really something i am used to enjoying

Thanks for choosing my comment from the last newsletter

I truly appreciate!

As for this weeks newsletter, I can’t really relate, seeing that I have always sucked in science class,

Maybe I am still no good at it!

To many numbers just makes me feel lost😂

Expand full comment
Tobi Akinpelu's avatar

You’re most welcome, Dapo.

By the way, have you given the article a read? If you still don’t understand it after this newsletter, please let me know.

Expand full comment
Gbenga Akinpelu's avatar

Answer to question 1.

Recursive, once you're discovered that value, you would start over again. While in Iterative, only loop once because it memorises the last two digits number or value each time.

Answer to question 2.

Fibonacci number at position 13.

At position 13 is (55+89) =114

Expand full comment
Gbenga Akinpelu's avatar

Correction to the input number..

At position 13 is (55+89) = 144.

Expand full comment
Tobi Akinpelu's avatar

This is a perfect and glowing answer. Correction to the input number recovered. Thank you.

Expand full comment
Rhume Disi's avatar

In using the recursive method to get a fibonacci number, we reduce the problem to calculating the sum of the last two fibonacci numbers until we hit the base case. In the example above, the base case is p <= 1. Then the fibonacci numbers add up (like a stack).

In the iterative method we are leveraging a loop (for or while) to compute the fibonacci of a number by adding the last two numbers given the first two numbers. In the iterative method, we consistently keep track of the last two numbers using two variables.

The fibonacci number at position 13, p13 is 144 i.e (55 + 89)

Expand full comment
Tobi Akinpelu's avatar

Superly correct.

Expand full comment
Aeesha's avatar

I just understood what tha fibonnaci sequence actually is 😅😅. Thank you

Expand full comment