Tuesday, February 22, 2011

Project Euler 3 WIP

The third problem is:

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


Should be simple in a brute force way - first find a factor, then test if that factor is prime. If it is, store it. I shouldn't have to keep checking if it's bigger than the last stored factor since each found will be larger than the next. I can re-use the prime finder program I made a while back - although I have to do some obvious improvements to it first.

I'm hoping that this problem won't give an instant result like the others have. If there is a noticeable delay between execution and result then it will be easier to know if any improvements I make are making the program swifter.

I can't think of the word that means "to make something more efficient".

No comments:

Post a Comment