Skip to content

Instantly share code, notes, and snippets.

@edfuh
Created October 2, 2011 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edfuh/1257717 to your computer and use it in GitHub Desktop.
Save edfuh/1257717 to your computer and use it in GitHub Desktop.
Euler #5
memo = [0, 1]
def memofib(n):
if n >= len(memo):
i = len(memo)
while i <= n:
memo.append(memo[i-1] + memo[i-2])
i += 1
return memo[n]
def fiblong (n) :
return n > 10 ** 999
i = 1
while fiblong(memofib(i)) != True:
i += 1
print i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment