$\begingroup$

Using PARI/GP, I searched for primes of the form $n!\pm k$ where $k

e 2$ is prime and $n\in \Bbb{N}$.

With the help of user Peter, we covered a range of $k \le 10^7$ and couldn't find a prime $k$ for which there is no prime of either form $n!+k$ or $n!-k$.

Observations:

$(1)$ When $n \ge k$, $n! \pm k$ cannot be prime as $k$ will be a factor of $n! \pm k$. This means that there are a finite number of primes of the form $n! \pm k$ for each $k$.

$(2)$ As $k$ increases, the number of primes of the form $n!\pm k$ also seems to increase. The reason for this is that as $k$ increases, the number of $n$ for which $n!\pm k$ may be prime also increases as all $n \lt k$ may give prime $n!\pm k$.

For those who want to carry forward the search here is the PARI/GP code:

for(k=1, 10^4,b=0; for(n=1, prime(k), if(ispseudoprime(n!+prime(k))==1, b=b+1)); print([prime(k), b]))

The first column of output will give the $k$ and the second column will the number of times $n!+k$ is prime for that given $k$. Here are the first few lines of output:

[2, 1] [3, 1] [5, 3] [7, 4] [11, 5] [13, 3] [17, 6] [19, 7]

For rest of the output computed till now click here.

Question:

Is there any prime $k

e 2$ for which there are no primes of the form $n!\pm k$?

Extra:

I decided to test some other factorial-like functions and they gave surprisingly similar results.

For any prime $k$, there is at least one prime of the form:

$(1)$ $p_n$#$\pm k$, where $p_n$# is the primorial function and $k\gt 5$. This was verified for the range of $k\le 10^7$.

$(2)$ $n!!\pm k$, where $n!!$ is the double factorial and $k\gt 2$. This was verified for the range $k\le 10^5$.

$(3)$ $2n!!\pm k$ where $n$ can only odd and $k\gt 5$. This was verified for the range $k\le 10^5$.

I find it strange that a function that grows relatively slow like $2^n+2131$ doesn't have a single prime even for $n\le 10^4$, but a fast-growing, factorial-like function like $n!+prime(k)$ has primes for every single $k$ even after being restricted by $n \lt k$.