one-file-projects/fibonacci_small.py
2014-08-31 06:14:41 +02:00

7 lines
No EOL
142 B
Python

from math import sqrt
psi = (1+sqrt(5))/2
phi = 1/sqrt(5)
fib = lambda k: int(phi*(psi**k - (-1/psi)**k))
for i in range(100):
print(fib(i))