i am about to build a list of primes up to 1024.. then i 've got two ideas.. the one -brute force divisibility testings..start from the firti prime and proceed to the next one etc..
but the other one- which if it is true may be fastest is: start from the nearest prime number to sqrt(n), see if it divides the number.. if not go to the previous one.. the firs to find is the largest.. do you think its ok??
my problem in the second idea is what will happen if the sqrt(n) is bigger than 1024.. how can i check if there is at least one prime factor between 1024 and sqrt(n)..??
This post has been edited by ghostrider_: 20 April 2010 - 03:12 PM

New Topic/Question
Reply



MultiQuote



|