What is the largest prime factor of the number 600851475143 ?
There are some answers online, but I want to solve it myself. Can somebody please help me out? This is what I have. If I replace 600851475143 by 1000 (for example), it works fine until 2 divides 1000 to 500, 250, 125...but when it has to find the next divisible prime (ie 5) it cannot do that and the program stops working.