mirror of
https://github.com/correl/euler.git
synced 2024-11-27 19:19:50 +00:00
12 lines
255 B
Python
12 lines
255 B
Python
def pfactor(n):
|
|
i = 2
|
|
while (n % i != 0 and i < n):
|
|
i = i + 1
|
|
if i == n:
|
|
return [n]
|
|
p = pfactor(n // i)
|
|
p.append(i)
|
|
return sorted(p, reverse=True)
|
|
|
|
print 'Prime factors of 600851475143:'
|
|
print pfactor(600851475143)
|