Are there arbitrarily large gaps between consecutive primes? [duplicate]

Solution 1:

Can we infer that there exist two numbers separated by a gap of $10000$, such that no number in between them is prime?

We can infer this regardless of what you wrote.

For every gap $n\in\mathbb{N}$ that you can think of, I can give you a sequence of $n-1$ consecutive numbers, none of which is prime.

There you go: $n!+2,n!+3,\dots,n!+n$.

So there is no finite bound on the gap between two consecutive primes.

Solution 2:

The Prime Number Theorem states that the number of primes $\pi(x)$ up to a given $x$ is $$\pi(x) \sim \frac{x}{\log(x)}$$ which means that the probability of finding a prime is decreasing if you make your "population" $x$ larger. So yes, there exist a gap of $n$ numbers whereof none are prime.

The way to find the first gap for some $n$ has to be done through the use of software, since the exact distribution of prime numbers is only approximated by $\frac{x}{\log(x)}$.

EDIT: That the PNT implies that there's always a gap of size $n$ can be seen by considering what would happen if this was not the case; if there was a maximum gap of $n$ that was reached after some $x$, the probability of finding a prime between $x$ and some larger number $m$ would no longer decrease as $m \to \infty$, which contradicts the PNT.

Solution 3:

We cannot infer from the two observations in the question that there are gaps of arbitrary sizes between primes. As Lovsovs mentions in his answer, this does follow from the Prime Number Theorem (one needs suitable error bounds on the approximation $\pi(x) \sim \frac{x}{\log x}$, but even crude ones will do here).

As asked in the comments, it's easy to construct for any positive integer $k$ a sequence of $k$ consecutive composite numbers. For any positive integer $a \leq k + 1$, $a$ divides $(k + 1)!$, and so it divides $(k + 1)! + a$, but this implies that each of the $k$ numbers $(k + 1)! + 2, \ldots, (k + 1)! + (k + 1)$ is composite. (This is generally not the first sequence for which this is true: For example, for $k = 3$, the resulting sequence is $26, 27, 28$, but the first sequence of three consecutive composite positive integers is $8, 9, 10$.)