login
A369858
Number of fixed elements when the first n prime gaps are sorted.
1
0, 1, 2, 3, 4, 3, 4, 5, 6, 7, 5, 6, 6, 6, 7, 8, 9, 8, 9, 10, 9, 10, 9, 10, 11, 10, 10, 11, 11, 10, 11, 11, 11, 9, 9, 12, 11, 11, 12, 13, 14, 13, 13, 16, 17, 17, 17, 18, 19, 20, 18, 18, 18, 18, 18, 18, 19, 18, 19, 18, 18, 18, 19, 19, 20, 21, 22, 22, 22, 20, 20, 19, 19, 20, 20, 20
OFFSET
0,3
COMMENTS
Let G = A001223(1..n) be the first n prime gaps, and H = sort(G) the sequence of the same terms but in nondecreasing order. Then a(n) counts the zeros in G-H.
StackExchange user Daniel Tisdale described this sequence in 2014 and observed that the sequence appeared to grow like primepi(n) ~ n/log(n). It is not presently known if that is true.
LINKS
Daniel Tisdale, Sorting of prime gaps, math.StackExchange.com, Aug. 11, 2014.
PROG
(PARI) apply( {A369858(n, p=primes(n+1))=#[0|d<-vecsort(p=p[^1]-p[^-1])-p, !d]}, [0..99]) \\ M. F. Hasler, Apr 24 2024
(Python)
from sympy import prime
A1223=[] # this list starts at index 0, unlike function A001223
def A369858(n):
if (L:= len(A1223)) < n:
A1223.extend(prime(k+2)-prime(k+1) for k in range(L, n))
return sum(a==b for a, b in zip(A1223[:n], sorted(A1223[:n]))) # M. F. Hasler, Apr 26 2024
CROSSREFS
Cf. A001223 (prime gaps).
Sequence in context: A280242 A325953 A245343 * A341019 A360535 A255938
KEYWORD
nonn
AUTHOR
M. F. Hasler, Apr 24 2024
STATUS
approved