Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andrew Tribone
committed
Oct 25, 2011
1 parent
9c0cc71
commit fc0106a
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
def isprime(n): | ||
n = abs(int(n)) | ||
if n == 2: | ||
return True | ||
if not n & 1: | ||
return False | ||
for x in range(3, int(n**0.5+1), 2): | ||
if n % x == 0: | ||
return False | ||
return True | ||
|
||
n = 600851475143 | ||
|
||
for x in range(3, int(n**0.5+1), 2): | ||
if n % x == 0: | ||
if isprime(x) is True: | ||
print x | ||
|