Skip to content

Instantly share code, notes, and snippets.

@soimort
Created March 5, 2012 00:54
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 soimort/1975722 to your computer and use it in GitHub Desktop.
Save soimort/1975722 to your computer and use it in GitHub Desktop.
Project Euler - Problem 3
n = 600851475143
while n % 2 == 0:
n //= 2
i = 1
while n > 1:
i += 2
while n % i == 0:
n //= i
print(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment