How many consecutive composite integers follow k!+1? - MathOverflow [closed]most recent 30 from http://mathoverflow.net2013-05-24T19:26:06Zhttp://mathoverflow.net/feeds/question/54074http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://mathoverflow.net/questions/54074/how-many-consecutive-composite-integers-follow-k1How many consecutive composite integers follow k!+1?Willy2011-02-02T08:17:47Z2011-02-02T14:54:12Z
<p>I originally thought this question was too basic for MathOverflow, so I tried Math.StackExchange, but no one there seemed to have a solution. Here goes.</p>
<p>How many consecutive composite integers follow <code>k!+1</code>? I wrote a program in Mathematica to compute explicit answers for the first 300, but there doesn't seem to be much of a pattern. The results of that are <a href="http://dl.dropbox.com/u/1277378/fact.txt" rel="nofollow">here</a>. This is a problem in Underwood Dudley's <em>Elementary Number Theory</em> (section 23.2 part (b)), but for the LIFE of me, I can't figure it out! My initial thought was this: Let <code>m</code> be the smallest prime such that <code>k<m</code>. Then any number of the form <code>k!+i</code>, where <code>1<i<m</code> will clearly be composite. Hence, there are at least <code>m-2</code> composite numbers which follow <code>k!+1</code>. However, past that it seems hard to say. For example, <code>11!+13</code> factorizes as <code>199*200587</code>, which seems to be unpredictable behavior. I'm leaning toward thinking this was a misprint in the book and it's a much harder problem than something that should be in <em>Elementary Number Theory</em>. Perhaps I'm overlooking a simple, elegant solution.</p>
<p>The other thing is, if there <em>were</em> a closed-form solution, then we would have an easy formula for calculating arbitrarily large primes. Take the largest known prime <code>p</code> and suppose we determine that <code>q</code> composite numbers follow <code>p!+1</code>. Then <code>p!+2+q</code> is prime.</p>
http://mathoverflow.net/questions/54074/how-many-consecutive-composite-integers-follow-k1/54100#54100Answer by Johan Andersson for How many consecutive composite integers follow k!+1?Johan Andersson2011-02-02T14:54:12Z2011-02-02T14:54:12Z<p>This seems like an interesting problem. Prime gap problems are notoriously difficult (Compare with Cramer's conjecture) and I do not expect this to be any easier. I will therefore not give a definitive answer, but rather try to give some heuristics. The Cramer model (see for example the paper of Granville "Harald Cramer and the distribution of prime numbers") where we assume that the probability that $n$ is prime is about $1/\log n$ gives that the probability that $k!+j$ should be prime should be about $1/\log(k!)$ which by Stirling's formula is about $1/k \log k$. This would give an average prime gap of about $k\log k$.</p>
<p>One might reason a little bit further. Of course when we consider $k!+j$ for $2 \leq j \leq k$ we have forced these number to be composite. In general the number $k!+j$ will be composite if some prime factor of $j$ is less than $k$.
We may then ask what is the probability that the number $j$ has all prime factors greater than $k$? If $k < j < k^2$ this is true if and only if $j$ is prime which has probability about $1/\log j$ which if $k < j < k (\log k)^N$ is about $1/\log k$. One might then expect the probability that the number $k^2+j$ to be prime should be the product of these probabilities or $1/(k(\log k)^2)$. </p>
<p>However then we have not recognized the fact that we have forced the number $k!+j$ to have no prime factor less than $k$. This means that we should look at the conditional probability that an integer $n$ is prime given that it has no prime factors less than $k$. A simple sieving argument shows the number is odd should give us $1/2$ of the numbers, forcing that the number is not divisable by 3 should give us about $2/3$ of the numbers, and so forth. In general we should have about
$$\prod_{p \le k} \left(1-\frac 1 p \right) \sim \frac{e^{-\gamma}}{\log k}$$
(By Merten's formula) numbers remaining after the sieving process. This is also suggested by the use of Dirichlet's theorem. This should give us the probability $e^{\gamma}/k \log k$ that the number $k!+j$ is prime, which is up to a constant the same as suggested by the Cramer model. In both cases the average prime gap can be expected to be of the order $k \log k$, albeit with different constants.</p>