I'm learning Python at the moment and to give me reasons to apply what i'm learning I'm having a crack at some of the problems on Project Euler
I'm currently on number 3, which is to determine the highest prime factor of said number.
I've deduced I need to probably have two algorithms, one to determine primality, and the second which would involve finding factors of the number.
So i've been reading up on Wiki articles. Trying to determine what might be the best algorithm to use and how to go about it.
But it's been a while since i've done some hardcore maths based programming and i'm struggling to start somewhere.
I was looking at using Fermat's factorization method with inclusion of Trial by Division but I don't want to make something too complicated I'm not after to crack RSA I just want two algorithsm suitable for my problem and there in lies my question.
What algorithms would you use for testing for primality / factoring a number that are suitable to the problem at hand?
Thank you all for your answers and insights they have been most helpful I upvoted all that were useful either through advice or through there own Euler experiences. The one I marked as right was simply the most useful as It gave me a proper place to start from which was a push in the right direction. Thanks again =)