Skip to content

Instantly share code, notes, and snippets.

@yasuharu519
Created July 25, 2012 17:10
Show Gist options
  • Save yasuharu519/3177307 to your computer and use it in GitHub Desktop.
Save yasuharu519/3177307 to your computer and use it in GitHub Desktop.
# -*- coding:utf-8 -*-
prime_number = list()
def function(num):
count = largest = 1
while num != 1:
count += 1
if any([count % x == 0 for x in prime_number]):
continue
else:
prime_number.append(count)
while num % count == 0:
num /= count
largest = count
return largest
print function(600851475143)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment