Can anybody point me an algorithm to generate prime numbers, I know of a few ones (Mersenne, Euclides, etc.) but they fail to generate much primes...
The objective is: given a first prime, generate the 'n' next primes. But thanks for the link ;-)
for example : primes( 17, 50 ) -> Generate 50 consecutive primes starting at 17
and do not fail any prime in this 50... no holes!


Here is a paper that contains a prime recurrence defined by
$$a_{n+1} = a_n + gcd(n,a_{n-1}),$$
where $gcd$ is the greatest common divisor function.
A favorite of mine is given by Mills' theorem, but since we cannot compute the number directly (yet...?), it is not feasible to generate primes with it.