CoCalc Shared FilesFIBO / fibonacci.sagews
Author: Hal Snyder
Views : 27
Description: Celebrate #FibonacciDAy

# Fun with Fibonacci numbers

Seen on Twitter: today is #FibonacciDay.

Month and day have same digits as first 4 Fibonacci numbers.

Contents:

• BASH agrees, it's Fibonacci day.
• Sagemath can tell you Fibonacci numbers (spoils the fun, sort of).
• Fibonacci numbers aspire to the golden ratio.
• Broccoli for mathematicians.
%sh
# Bourne shell confirms it
date +"%m-%d"

hello from init.sage 11-26

## Sagemath

There is built-in support for Fibonacci numbers in Sagemath.

fl = list(fibonacci_sequence(1, 21))
fl

hello from init.sage [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765]
fr = [(fl[i+1]/fl[i]).n() for i in range(6)]
fr
fe = list(enumerate(fr))
fe

[1.00000000000000, 2.00000000000000, 1.50000000000000, 1.66666666666667, 1.60000000000000, 1.62500000000000] [(0, 1.00000000000000), (1, 2.00000000000000), (2, 1.50000000000000), (3, 1.66666666666667), (4, 1.60000000000000), (5, 1.62500000000000)]

## the Golden Ratio

Sagemath has built in support for the golden ratio.

And the ratio of successive Fibonacci numbers approaches the Golden Ratio.

$\lim_{n\to\infty}\frac{F_{n+1}}{F_n} = \varphi$

# Here's a plot of the first few quotients.
# Magenta line marks the golden ratio.
p1 = plot(golden_ratio,(x, 0, 5), color="magenta")
p2 = line(fe, marker='o', markersize=8)
p1+p2


## Romanesco

Romanesco Broccoli is a naturally occurring example of a Fibonacci fractal.

Image credit: Wikipedia on Romanesco broccoli