Created
May 20, 2015 06:10
-
-
Save vexorian/bedafd7e1baf9d057f95 to your computer and use it in GitHub Desktop.
first 100 fibonacci numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fibo(): | |
A = [ | |
[ 0, 1 ], | |
[ 1, 1 ], | |
] | |
x = [0, 1] | |
for i in range(100): | |
print x[0] | |
y = [0, 0] | |
(x[0], x[1]) = x[0] * A[0][0] + x[1] * A[0][1], x[0] * A[1][0] + x[1] * A[1][1] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment