OFFSET
1,1
COMMENTS
In case of ties the smallest value is chosen. - Pontus von Brömssen, Jul 25 2026
The density of primes occurring with these numbers A060267(k) appears to max out at higher and higher values of 6*x. For example, looking at numbers in the sequence for next and previous prime differences, we have the following table for n-th powers of 10.
n | most common difference | number of occurrences
---+------------------------+----------------------
1 | 2 and 4 | 2
2 | 6 | 21
3 | 6 | 132
4 | 6 | 897
5 | 6 | 5820
6 | 12 | 48030
7 | 18 | 394659
8 | 18 | 3462648
9 | 30 | 32669865
10 | 30 | 310596450
11 | 30 | 2910322455
Conjecture: The maximum density occurs at increasing multiples of 6 as the number of primes tested approaches infinity. E.g. the number of nextprime - prevprime occurrences for 2*k <= 10^10 will be 30 or higher. This appears as a plausible statement since as 2*k increases, the probability that the difference between the next and previous prime will contain larger and larger prime factors.
EXAMPLE
For n = 3, we have the difference between nextprime and prevprime for 2*k <= 10^3:
difference | number of occurrences
-----------+----------------------
2 | 35
4 | 80
6 | 132
8 | 60
10 | 80
12 | 44
14 | 49
16 | 0
18 | 9
20 | 10
6 occurs 132 times in the differences for 2*k <= 10^3. Thus 6 has the maximum number of occurrences and is the third entry in the table. So a(3) = 6.
PROG
(PARI) prmppr(n) = { mx=0; f = vector(floor(sqrt(n)+2)); forstep(x=4, n, 2, y=nextprime(x)-precprime(x); print1(y", "); if(y>mx, mx=y); f[y]++; ); print(); mx2=0; forstep(x=2, mx, 2, if(f[x] > mx2, mx2=f[x]; d=x); print(x", "f[x]); ); print(d", "mx2) } \\ use prmppr(1000) to get a(3)=6
(PARI) f(n) = nextprime(2*n+1) - precprime(2*n-1); \\ A060267
a(n) = {my(v=vector(10^n/2-1, k, f(k+1))); my(nbm = 0, imax = 0); forstep (i=vecmin(v), vecmax(v), 2, my(nb = #select(x->(x==i), v)); if (nb > nbm, nbm = nb; imax = i); ); imax; } \\ Michel Marcus, Sep 16 2020
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Cino Hilliard, Apr 18 2004
EXTENSIONS
Edited by Michel Marcus, Sep 16 2020
a(1) and a(10)-a(11) from Pontus von Brömssen, Jul 25 2026
STATUS
approved