reset password
Author Message
RayHopefield
Posts: 4
Posted 17:53 Sep 23, 2017 |

In Project3 6.c we supposed to implement sieve of Eratosthenes to generate the first n primes. But sieve of Eratosthenes is algorithm for generating prime list that lower than N.

How can we generate input list [2..N] that contains prime numbers more than n?

rabbott
Posts: 1649
Posted 19:39 Sep 23, 2017 |

The sieve of Eratosthenes generates an endless list of primes. The problem asks for the first n of them for arbitrary n. It doesn't require that the primes come from [2 .. n]. The primes are from [2 .. ]. The Wikipedia example arbitrarily stops with primes below 121. But there is no reason to stop there -- or at any particular upper bound. 

RayHopefield
Posts: 4
Posted 21:17 Sep 23, 2017 |

Got it professor. Thank you so much.