Created
November 28, 2011 01:31
-
-
Save jakedobkin/1398715 to your computer and use it in GitHub Desktop.
Euler 25
This file contains hidden or 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
| # set initial terms in fib sequence | |
| a = 1 | |
| b = 1 | |
| c = 0 | |
| string = "" | |
| count = 3 | |
| # generate fib sequence until you get a number with 1000 digits | |
| while (len(string) <= 1000): | |
| c = a + b | |
| a = b | |
| b = c | |
| string = str(c) | |
| length = len(string) | |
| if (length == 1000): | |
| print "fib number %d has %d digits" % (count, length) | |
| count = count + 1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment