# Finding how many prime numbers lie in a given range

How many prime numbers $p$ are there which satisfy this condition?

$$13! +1 \lt p \leq 13! +13$$

Which method should I use to solve this, or could you help with the first steps?

• First step: see if you can tell whether $13!+2$ is prime. Second step: see if you can tell whether $13!+3$ is prime. – Erick Wong Dec 4 '16 at 18:19
• In this small of a range instead of using probable prime formulae, you can manually use primality tests. – Eli Sadoff Dec 4 '16 at 18:21

None, since $13!+n$ is divisible by $n$ for every $n\in[2,13]$.

This technique is also used for proving that there is no finite bound on the gap between two primes, since for every $n\in\mathbb{N}$, there is a consecutive sequence of (at least) $n-1$ numbers, none of which is prime:

• $n!+2$, which is divisible by $2$
• $n!+3$, which is divisible by $3$
• $\dots$
• $n!+n$, which is divisible by $n$

Notice that if $2 \le k \le 12$ then $k \mid 13!$ because $13! = 1 \cdot (k-1) \color{red} {\cdot k} \cdot (k+1) \cdot \dots 13$, therefore $k \mid 13! + k$ whenever $2 \le k \le 12$, so none of the numbers $13! + k$ with $2 \le k \le 12$ is prime.

I think this question has been answered well above. When it comes about numbers:

$13! = 6227020800$

So the range you are looking for is: $6227020802 - 6227020813$

Numbers ending up $...802, ...804, ...806, ...808, ...812$ are divisible by $2$.

Numbers ending up $...803, ...809$ are divisible by $3$.

$...805, ...810$ are divisible by $5$.

$...807$ are divisible by $7$.

$...811$ and $...813$ are good candidates for prime numbers. You could check if they are semiprimes or composite numbers. Unfortunately $...811$ is divisible by $11$ and $...813$ is divisible by $13$.

• While in base 10 your observations over numbers multiple of 2 and 5 are correct, you should review your statements about multiples of 3 and 7. – Lorenzo Dec 4 '16 at 23:40
• I was going to edit it, cos I knew it might be confused. $6227020803$ is divisible by $3$ - this what I was meant and so on. Perhaps I shouldn't use plural form and write a whole number. To find out if a number is divisible by $7$, 'take the last digit, double it, and subtract it from the rest of the number' should be added as well. – usiro Dec 5 '16 at 0:01
• More interesting thing is why I haven't included 6227020810 as divisible by $2$ rather then by $5$. There is an important reason for that, but not really important for the question. – usiro Dec 5 '16 at 0:17

What you have to remember is that $n!$ is divisible by each prime number $p \leq n$. Then $n! + p$ is also divisible by $p$.

In the specific case of $n = 13$, it follows that $13!$ is divisible by $2, 3, 5, 7, 11, 13$, and consequently, $13! + 2$ is divisible by $2$, $13! + 3$ is divisible by $3$, you get the idea.

So yeah, no primes there.