Question: Suppose when searching for a large prime, our first step is to sieve by eliminating the first n primes. How large should n be to

Suppose when searching for a large prime, our first step is to sieve by eliminating the first n primes. How large should n be to speed up our search by a factor of 10? This requires careful thought and inventiveness before doing a computation. How to approach this: Eliminating all odd numbers speeds up our program by a factor of 2, since we've eliminated half of the choices that are composite. If we also immediately disqualify multiples of 3, then we speed up our program by a factor of 3, since we have eliminated 2/3 of all composites. Check that that argument is correct. Now see what happens when you eliminate all of 2,3 and 5. Again for 2,3,5,7. Now try to figure out the mathematical result and use it to solve for n.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!