Use a seive . it's complexity is O(nlog n)
1 million is 1*10^7 , this will run within time limit ... assuming u
optimize ur code enough !!

On Jan 26, 5:48 pm, juver++ <[email protected]> wrote:
> Generate primes numbers for the range 1..10^7 using sieve.
> Than apply sieve bigger range using these prime numbers.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to