Friday, September 13, 2013

Problem 3 - Largest Prime Factor

The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
_________________________________________________________________________________

j=600851475143 
i=1
while j>1:
 if j%i==0:
  j=j/i
  print i
 i=i+1

No comments:

Post a Comment