# Are there infinitely many primes $p$ such that $\frac{(p-1)! +1}{p}$ is prime?

Here I have the following conjecture:

Let $$S_1(n)= \frac{(n-1)! +1}{n}.$$ Then there exist infinite prime numbers $p$ for which $S_1(p)$ is prime.

And I don't know how to prove it.

EDIT
Let $C_1(n)=[S_1(n)]$ where $[n]$ denotes the integral part. Then I have another conjecture that $[C_1(1) ,C_1(2),C_1(3) ,C_1(4),C_1(5) ,C_1(6)...]$ contains infinite many primes . Are there any ways to prove it?

• Is there any motivation for this conjecture, i.e. why do you think it is true? I couldn't find any other solution else then 5,7,11,29 below 500. – benh Dec 28 '13 at 18:11
• @benh ... and $S_1(29)=10513391193507374500051862069$ is already quite a beast when talking about everyday primes. – Hagen von Eitzen Dec 28 '13 at 18:15
• These kind of questions (where the numbers are very sparse) are essentially always intractable, so good luck. – Igor Rivin Dec 28 '13 at 18:23
• Next after 29 seems to be 773, but my isprime is still running (though ispseudoprime was quite confident) – Hagen von Eitzen Dec 28 '13 at 18:25
• @RaymondManzoni lets say we have $S_2(n)= \frac{(n-2)! +1}{n}$ then can similar arguments be made and infinite primes proved in this case too? – Shivam Patel Dec 29 '13 at 14:07

The first primes solution are at OEIS as A050299 : $$1, 5, 7, 11, 29, 773, 1321, 2621$$ with the comment "There are no other terms up to $6550$ and the corresponding next prime has more than $22150$ digits. No more terms below $30941$."

Mike Oakes added a comment (and its correction since an important factor was missing) :
"Asymptotically, the probability that $p$ is prime is $\dfrac 1{\log(p)}$, and that $N =\dfrac {1+(p-1)!}p$ is prime is $\displaystyle \frac 1{\log(N)} \approx \frac 1{\log((p-2)!)} \approx\frac 1{p\log(p)}$ by Stirling.

CORRECTION: since no prime $< p$ divides $N$, the probability that $N$ is prime must be multiplied by the factor $\;e^{\gamma}\log(p)$ (using Mertens' theorem), where $\gamma$ is Euler's constant, with $e^{\gamma}=1.7810724\cdots$

So the expected number of such primes between $p_1$ and $p_2$ is of order : $$e^{\gamma}\;\int_{p_1}^{p_2} \frac{\log(x)\;dx}{x\log(x)^2} = e^{\gamma}(\log(\log(p_2))-\log(\log(p_1)))$$ which is unbounded as $\,p_2\to\infty$.

Putting in the numbers, this predicts:

1. that for $\;2 \le p \le 30941$ there should be $4.8$ such primes, which is in reasonable agreement with the actual number found ($7$); and
2. that asymptotically there is on average one such prime between $p_1$ and $p_2$ whenever $p_2 = (p_1)^{1.753....}$

Mike Oakes (with error pointed out by David Farmer, Dean Hickerson, Paul Jobling, Carl Pomerance, Bjorn Poonen, Noam D. Elkies)"

NEW PROBLEM:
Let's consider with more care the new problem for $n$ integer : $$C_1(n)= \left\lfloor\frac{(n-2)! +1}{n}\right\rfloor$$ I obtained the first solutions : $$7,29,61,139,383(?)$$

I'll distinguish two cases :

• $n$ not prime which is true with probability $\approx 1-\dfrac 1{\log(n)}$ multiplied by the $\dfrac 1{n\,\log(n)}$ term from Mike Oakes' analysis. The partial contribution for $n\in(n_1,n_2)$ will then be of order : $$\tag{1}\int_{n_1}^{n_2} \left(1-\frac 1{\log(x)}\right)\frac{dx}{x\log(x)} = \left.\log(\log(x))+\frac 1{\log(x)}\right|_{n_1}^{n_2}\approx\left.\log(\log(x))\right|_{n_1}^{n_2}$$
• for $n=p$ prime and using Wilson's theorem I got $\;(p-1)(p-2)!\equiv (p-1)\pmod{p}\;$ and (since $(p,p-1)=1$) $\;(p-2)!\equiv 1\pmod{p}\;$ so that $\;\displaystyle \left\lfloor \frac{(p-2)!+1}p\right\rfloor=\frac{(p-2)!-1}p$ but $(p-2)!-1$ can't have divisors smaller than $p-1$ and thus we still can't have divisors $<p$ when $p$ is prime $>3$ (another result $\;(p-1)\left\lfloor \frac{(p-2)!+1}p\right\rfloor=\frac{(p-1)!+1}p-1\,$).
The repartition for $n=p$ prime will thus be asymptotically the same as in your first problem : $$\tag{2}e^{\gamma}\;\int_{n_1}^{n_2} \frac 1{\log(x)}\frac{\log(x)\;dx}{x\log(x)} = \left.e^{\gamma}\;\log(\log(x))\right|_{n_1}^{n_2}$$ Combining $(1)$ and $(2)$ we get an average number of solutions in $(n_1,n_2)$ of order : $$\left(1+e^{\gamma}\right)(\log(\log(n_2))-\log(\log(n_1)))$$ and may hope for one solution going from $n_1$ to $n_2=(n_1)^c$ with $c=e^{1/(1+e^{\gamma})}\approx 1.433$ (instead of $e^{1/e^{\gamma}}\approx 1.753$ previously).
• Manzori suppose we have $S_2(n)= \frac{(n-2)! +1}{n}$ then what is the order of expected number of primes between $p_1$ and $p_2$? – Shivam Patel Dec 30 '13 at 9:03
• @ShivamPatel: I updated my answer and gave a solution for primes and for integers. – Raymond Manzoni Dec 30 '13 at 15:06