Two Sieving Problems

August 27, 2013

We have today two exercises devoted to enumerating prime numbers:

1) How many prime numbers are there between 1050 and 1050 + 106?

2) How many prime numbers between 1,000,000 and 2,000,000 are congruent to 1 (mod 4)?

Your task is to write programs that answer the two questions given above; you might note the hint in the title of the exercise. When you are finished, you are welcome to read or run a suggested solution, or to post your own solution or discuss the exercise in the comments below.


Pages: 1 2 3