Let $p_n$ be the $n$-th prime and $l_n, n \ge 2$ be the largest of all the prime factors of the composite numbers between $p_n$ and $p_{n+1}$. Since there are infinitely many prime gaps, each of these gap will have a largest prime factor in the gap. Also the same prime can be the largest prime factor in more than one prime gap; for example, $3$ is the largest prime factor between $(5,7), (11,13),(17,19),(71,73)$ etc.
For $p_n \le 3 \times 10^8$, I counted how many times each prime was the largest prime in some prime gap. The plot of the frequency of each prime occurring as the largest prime is shown below. Within the available data, the prime $113$ is the most frequent largest prime in gap with $2550$ occurrences and all the most frequent prime are in the neighborhood of $113$.
Questions:
- Is there any reason why one prime or primes in a certain neighborhood should occur more frequently?
- The most frequent prime $l_f$ for prime $p_n$ up to $3\times 10^5$ is $29$, up to $3\times 10^6$ is $53$, up to $3\times 10^7$ is $71$ and up to $3\times 10^8$ is $113$. As we go higher up the number line, the most frequent prime factor in the gaps increases. What is the asymptotic order for the most frequent prime factor in gaps for primes up to $p_n \le x$?
Update: Comment by @Gerry Myerson and data shows that the most frequent primes increases as we go higher up the number line.
Related question: Is every prime is the largest prime factor in some prime gap?
Source code
p1 = 3
i = s = 0
step = target = 10^6
l = []
while True:
i = i + 1
p2 = next_prime(p1)
g = p1+1
d_max = 2
while g < p2:
x = prime_factors(g)
if d_max < x[-1]:
d_max = x[-1]
g = g + 1
f = open('C:/WorkArea/Bhavcopy/Simulation/gap_primes2.csv','a+')
f.write(str((p1,p2,d_max)) + '\n')
f.close()
if i == target:
print(target)
target = target + step
p1 = p2
