OFFSET
1,1
COMMENTS
The first missing prime in the sequence is 17. First occurrence of a(n)+n-m < nextprime(a(n)) is at n = 20 (see Examples). It seems that 1/2 < n/(n+m) <= 1 and lim_{n->oo} n/(n+m) = 1/2 (or half of the primes are in this sequence).
EXAMPLE
primes 2 3 5 7 11 13 17 19 23 29 31 37 41 43 .. 97 101 103 107 109 113 127
n 1 2 3 4 5 6 7 8 9 10 11 .. 18 19 20 21
a(n) 2 3 5 7 11 13 19 23 29 37 43 .. 97 107 113 127
m 0 0 0 0 0 0 1 1 1 2 3 .. 7 9 10 10
a(n)+n-m 3 5 8 11 16 19 25 30 37 45 51 .. 108 117 123 138
a(n+1) 3 5 7 11 13 19 23 29 37 43 47 .. 107 113 127 137
PROG
(Python)
from sympy import primerange, prevprime, nextprime; p = 2; b = 0
for n in range(1, 57): print(p, end = ", "); q = max(nextprime(p), prevprime(p + n - b + 1)); m = len(list(primerange(p+1, q))); p = q; b += m
CROSSREFS
KEYWORD
nonn
AUTHOR
Ya-Ping Lu, Apr 03 2024
STATUS
approved