# Prove that every number between two numbersis composite

I have this problem, and I have no idea how to go about it:

Let $p_1,p_2, \ldots, p_{n+1}$ be the first $n+1$ primes, in order. Prove that every number in between $p_1 \cdot p_2 \cdot p_3 \ldots p_n+1$ and $p_1 \cdot p_2 \cdot p_3 \ldots p_n+p_{n+1}-1$ (inclusive) is composite. How does this show that there are gaps of arbitrary length in the sequence of primes?

I've already viewed the other two questions with similar names, but neither have answers that make sense to me. I was hoping someone could show me step by step how to do this. I don't understand how it could be inclusive and still be true.

• $p_1 \cdot p_2 \cdot \dots \cdot p_n + 1$ can in fact be prime. You need to start the interval at $p_1 \cdot p_2 \cdot \dots \cdot p_n + 2$ for this to be true. – Dan Brumleve Feb 13 '15 at 1:13
• This is why I'm confused. The question is worded exactly as above. I'm thinking it mean inclusive solely of the second number. @DanBrumleve – Ashley Feb 13 '15 at 1:18

## 2 Answers

I am assuming you only mean the "inclusive" to apply to the upper bound.

Every number $k$ from $2$ to $p_{n+1}-1$ has a prime factor $p$ (possibly $p$ is $k$ itself; if there is more than one possible $p$, just choose one). Moreover, since $k<p_{n+1}$, this factor $p$ cannot be $p_{n+1}$ or larger, but must be $p_1$ or $p_2$ or... or $p_n$. Therefore $$p\mid p_1p_2\cdots p_n$$ and so $$p\mid p_1p_2\cdots p_n+k\ .$$ Thus we have $p_{n+1}-2$ consecutive composite numbers (at least), and since there are infinitely many primes, this can be made arbitrarily large.

• I'm also just assuming that it's only inclusive of the upper bound. The problem is worded exactly as above, so it isn't super clear. I emailed my prof but he hasn't answered. – Ashley Feb 13 '15 at 1:26

Something is wrong, at the very least you can't mean "inclusive," i.e. including the endpoints of the range of numbers, because if you put $n=1$ then the range of numbers you get is $3$ to $5$ (inclusive) and $3$ and $5$ are prime, although $4$ is composite so it might work if you remove the "inclusive" part.