To be honest, I'm pretty awful at mathematics however, when up till 6AM I do like to do random things throughout the night to keep me occupied. Tonight, I began playing with the Fibonacci sequence in the Python programming language. I understand that the Fibonacci sequence is just adding the previous two numbers together to produce your next value so I defined a function to spit out the sequence up to the 200th number like so,
def fib(n):
a, b = 0, 1
i=1
while i < 200:
print("ITERATION: " + str(i))
a, b = b, a + b
print(a)
i += 1
print(fib(1))
What I found interesting is a pattern I came across when adding up the total amount of numbers before the sequence added the next digit. (see picture A.)
PICTURE A:
from there, I added up the number "sets" and the pattern emerged.(see picture B.)
PICTURE B:
This pattern continued, I went up to the 22nd "set" of numbers and the whole pattern was like so:
1
2
1
3
1
4
1
5
1
2
1
4
1
4
1
3
1
4
1
3
1
4
I found it interesting that the numbers added a digit sequentially by either 4 or mainly 5 integers and how the overall pattern that emerged out of the "sets" appeared to become less stable after the 8th set which was ironically 5;
1
2
1
3
1
4
1
5
forgive me if this seems obvious or silly, but like I said, I'm pretty bad at math. Can anyone explain why this pattern emerges and a little bit more in depth on what the fibonacci sequence can be used for?
Answer
The ratio between Fibonacci numbers soon settles down to a number close to $1.618$. This number is called the Golden Ratio.
You get an extra digit every time the Fibonacci numbers have increased by a factor 10.
$1.618^4=6.854$ and $1.618^5=11.09$
Once the ratio settles down, you get at least one extra digit every five numbers. Sometimes the extra digit arrives sooner, and you only get four numbers with so many digits.
No comments:
Post a Comment