login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A371694
a(1) = 2; a(n+1) is the larger prime between nextprime(a(n)) and prevprime(a(n)+n-m+1), where m is the number of primes < a(n) that are missing from the sequence.
0
2, 3, 5, 7, 11, 13, 19, 23, 29, 37, 43, 47, 53, 61, 71, 79, 89, 97, 107, 113, 127, 137, 139, 151, 163, 173, 181, 193, 199, 211, 223, 233, 241, 251, 263, 277, 283, 293, 307, 317, 331, 337, 353, 367, 379, 389, 401, 409, 421, 433, 449, 463, 467, 479, 491, 503
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
Cf. A362527.
Sequence in context: A005728 A050437 A096246 * A106639 A233462 A233893
KEYWORD
nonn
AUTHOR
Ya-Ping Lu, Apr 03 2024
STATUS
approved