# On the Cramér-Granville Conjecture and finding prime pairs whose difference is 666

Questions

If $p= \text{NextPrime}[q]$ (the smallest prime greater than $p$), and $p-q = 666,$ what are $p$ and $q$?

(There may be multiple choices. I am interested in finding one.)

Cramér-Granville Conjecture:
Defining $p_0=2$, and $p_n$ as the nth odd prime, and the nth prime gap as
$g_n=p_{n+1}-p_n$, then $g_n< M \log(p_n)^2$ for some $M>1$.

If $g_n =666$, what are generally good estimates for $M$ and $p_n$ according to the Cramér-Granville Conjecture? Can we make use of current sieve technology and probabilistic modeling to solve our problem efficiently?

Commentary & Previous Work

If $g_n = 666$ and $p_n = 18691113008663$, then the conjecture is satisfied for any $M>1$.

We let $\text{primegap}_{avg} = x/\pi(x) = g_n = 666$. If $\pi(x) = x/(li(x) + sqrt(x) * log(x)/(8\pi))$, then we have $x/\pi(x) = 666$ which implies $x = 4.73231\times10^{289}$ and $\pi(x) =7.10558\times10^{286}$. So our upper bound estimate of $p_n$ will be less than $4.73231\times10^{289}$.

Therefore, we shall focus our attention on finding consecutive prime pairs whose difference is $666$ in the open interval, $(18691113009329, 4.73231*10^{289})$. And we should expect to find approximately $(c/333)(\pi(4.73231×10^{289})-\pi(18691113009329)) = c *7.10558×10^{286}/333$, or $c * 2.133808*10^{284}$ consecutive prime pairs whose difference is $666$ where $0.5 < c < 1$.

Note: $c \to 1$ as $x\to\infty$ according to the Polignac Conjecture.

Furthermore, we also expect to discover sufficiently many prime gaps greater than $666$ in the open interval, $(18691113009329, 4.73231×10^{289})$, so that the prime gap density or average of $666$ is maintained. And according to the Cramér-Granville Conjecture, the maximum prime gap of $\log(4.73231\times10^{289})^2 = 444892$, more or less, exists in the open interval.

Boeyens, Jan C. A.; Levendis, Demetrius C. (2008), Number Theory and the Periodicity of Matter, Berlin: Springer-Verlag, ISBN 978-1-4020-6659-7;

'A Primer in Density Functional Theory', http://link.springer.com/book/10.1007%2F3-540-37072-2;

“Repetition and growth of prime gaps are essential for the efficient generation of the integers.”

• What a strange choice of number... – Simply Beautiful Art Oct 17 '16 at 18:41
• No Idea. However, $q > 7,177,162,611,713$ – Will Jagy Oct 17 '16 at 18:42
• @Simple Art Halloween is near! Watch out for those skeletons... :-) – Dave Oct 17 '16 at 18:42
• According to the "prime gap" wikipedia page, it is more than $7,177,162,611,713.$ en.wikipedia.org/wiki/Prime_gap – Thomas Andrews Oct 17 '16 at 18:44
• Is this question of any use? – user261263 Oct 17 '16 at 18:54

You can also use prime number theorem to get an estimation. Something like: $$\text{Find }x\text{ such that}\\\;\\ \frac{x+666}{\ln(x+666)}=\frac{x}{\ln x}+1$$ Edit:

Thanks to the online Wolfram Cloud, I came up with something like this:

gap[x_,d_]:=(x+d)/Log[x+d]-x/Log[x]-1;
FindRoot[gap[x,666],{x,1000}]


which resulted in $x=3.8013\times 10^{17}$

• This answer calculate when the average gap reaches 666. The question was only for a a single example, which is found far earlier. – Stig Hemmer Oct 18 '16 at 8:11
• @StigHemmer And I used the word estimation for a purpose. If you know the order of magnitude, the search would be easier – polfosol Oct 18 '16 at 8:18
• @polfosol Your estimate is off by 4 orders of magnitude. Because it's estimating the wrong thing. – Taemyr Oct 18 '16 at 10:12
• @innisfree OK, I give up. Maybe we have the wrong idea about the order of magnitude. I mean, if I wanted to do a brute-force search for such number, I would have first evaluated to see what I am dealing with. Of course this estimate is too far, but at least I know that I shouln't start with numbers less than say, 100 million... – polfosol Oct 18 '16 at 10:18
• And by the way, the value that WolframCloud gave me is the result of an overflow! The actual value for which gap[x,666]=0 is much much larger – polfosol Oct 18 '16 at 10:22

According to the table compiled by Thomas Nicely, $q=18{,}691{,}113{,}008{,}663$ is the first occurrence of $666$ as a prime gap. Nicely attributes the value to a 1989 paper by Jeff Young and Aaron Potler.

• +1 I was about to give $2222222222222240257$ (found by trial an error, not very satisfying!), but your answer is more useful I think :) – Jean-Claude Arbaut Oct 17 '16 at 19:09
• @Jean-ClaudeArbaut, I'd be curious to hear how trial and error led you to that number. – Barry Cipra Oct 17 '16 at 19:19
• @Barry Cipra and Jean-Claude Arbaut Thanks!! :-) – Dave Oct 17 '16 at 19:20
• @BarryCipra Dirty approach: start with some more or less "random" N, compute initially N:=NextPrime(N) to really start with a prime, then in a loop compute P:=NextPrime(N), stop if P-N=666 else N:=P and continue to next loop. Do that M times and if nothing is found, try another starting N. It worked on my third attempt, with initially $N=2222222222222222222$. I did this in GAP, but as long as you have a NextPrime function, it's ok. Notice that you get only "probable primes", as GAP uses a probabilistic primality test, but see this. – Jean-Claude Arbaut Oct 18 '16 at 5:20