Flame:
Hey now, it's not the LEAST effective way! The LEAST effective way would be to attempt to divide the number by every number between 2 and the number. My method has a cost of Sqr(N)/2 rather than of N. (Assuming you only bother with skipping all the even numbers rather than trying to avoid checking every prime multiple of course.)
Also my method is easy to understand whereas all those other methods are horribly complicated and I can't understand any of them! So there!
/never took Calculus
Hey now, it's not the LEAST effective way! The LEAST effective way would be to attempt to divide the number by every number between 2 and the number. My method has a cost of Sqr(N)/2 rather than of N. (Assuming you only bother with skipping all the even numbers rather than trying to avoid checking every prime multiple of course.)
Also my method is easy to understand whereas all those other methods are horribly complicated and I can't understand any of them! So there!
/never took Calculus