Reputation: 159
I have a really large number 510143758735509025530880200653196460532653147
from which I want to obtain its prime factors (or at least the two biggest factors) in python. I have tried with several codes but they run for ages and they don't finish. So I'm asking, is there any fast way or at least a way to compute the prime factors of a number this big?
PS: for example, one of the codes I used.
def prime_factors(n):
i = 2
factors = []
while i * i <= n:
if n % i:
i += 1
else:
n //= i
factors.append(i)
if n > 1:
factors.append(n)
return factors
Upvotes: 1
Views: 1216
Reputation: 17876
I used PariDroid on my cell phone; it completed the factorization in an instantL
factor(510143758735509025530880200653196460532653147) =
19704762736204164635843 * 25889363174021185185929
Upvotes: 2
Reputation: 159
Found a way using this webpage, just if someone needs it. http://factordb.com/index.php?query=742449129124467073921545687640895127535705902454369756401331
Upvotes: 0