This program generates φ, also called the golden ratio. It creates the fibonacci sequence and divides the newly generated number by the last one. In theory this program would generate exactly φ.

#### Fibonacci sequence

#### The golden ratio (φ)

```
# Python 2.7.7 Code
# Jonathan Frech 6th of April, 2015
```

```
# begin
x1, x2 = 1, 1
# create fibonacci sequence to the 1000th number (integer overflow)
for _ in range(0, 1000):
# print out phi
print "phi = " + str(float(x2) / x1)
# generate fibonacci
x = x1 + x2
x1 = x2
x2 = x
```

Advertisements