Submitted by porichoygupto t3_10k5197 in Jokes
gotbetterbro t1_j5p9krd wrote
The Fibonacci sequence is a series of numbers in which each number is the sum of the two that precede it. Starting at 0 and 1, the sequence looks like this: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, and so on forever. The Fibonacci sequence can be described using a mathematical equation: Xn+2= Xn+1 + Xn.
Noooooodlez t1_j5pqxmb wrote
I learned something today. Thank you.
gotbetterbro t1_j5s9hsk wrote
Youre welcome !
RecalcitrantHuman t1_j5r03ky wrote
Are we just gonna gloss over how we get from 0 to 1?
RevolutionaryRough37 t1_j5r5ybb wrote
They're the base cases of the recursion and are therefore 0 and 1 by definition. You need two base cases because the recursive function uses the previous two numbers in the series to calculate the current one.
Edit: Sorry calling them base cases is inaccurate since that's another thing entirely in recursion. The reason they're defined stands though, the recurrence requires two initial values to work.
DieFlavourMouse t1_j5s0mlz wrote
>Are we just gonna gloss over how we get from 0 to 1?
In the beginning there was nothing...
DieFlavourMouse t1_j5s1657 wrote
Great explanation. I'm no mathematician but I recently stumbled down a wondrous rabbit hole and this is probably the best place to share it.
"A Handbook of Integer Sequences" Fifty Years Later
And, The Online Encyclopedia of Integer Sequences itself.
gotbetterbro t1_j5s9o6t wrote
I will give it a look thank you
Viewing a single comment thread. View all comments