Skip to content

Instantly share code, notes, and snippets.

@nicholsonjf
Last active August 29, 2015 13:58
Show Gist options
  • Save nicholsonjf/10074580 to your computer and use it in GitHub Desktop.
Save nicholsonjf/10074580 to your computer and use it in GitHub Desktop.
Project Euler #104 notes
# Below function returns the index of the first number in the
# fibonacci sequence where first nine digits contain integers 1-9
def first_nine():
a, b, indexb = 1, 1, 2
nine = set('123456789')
b_first_nine = set(str(b)[:9])
while (nine <= b_first_nine) == False:
a, b, indexb = b, b + a, indexb + 1
b_first_nine = set(str(b)[:9])
print indexb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment