Prime Numbers

In class Tuesday a student asked if there are enough prime numbers in the neighborhood of a few thousand bits long, and I said yes. Here's a proof and an assertion:

Euclid proved that there are an infinite number of primes. The proof is pretty simple. Suppose there are a finite number of primes. Then, if pi is the ith prime, we can write the product of all primes as P= p1 × p2 × ... × pn, where n is the index of the largest prime. Since P is finite, so is P+1. P+1 is not divisible by any of the primes, in other words, P+1 has no prime factors. This is means P is prime, but it's larger than pn, which contradicts the assumption that there is a largest prime. So, there must be an infinite number of primes (see Ferguson and Schneier, Practical Cryptography, Wiley, 2003, pp. 187-188).

Also from Ferguson & Schneier (p. 198), "In the neighborhood of a number n, approximately one in every ln n numbers is prime." ln here is loge. Another way of phrasing this is that the probability that a random integer r is prime is approximately 1/(ln r).

From here one can go

, Jeff Martens.