cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A371694 #4 Apr 04 2024 10:32:38
%S A371694 2,3,5,7,11,13,19,23,29,37,43,47,53,61,71,79,89,97,107,113,127,137,
%T A371694 139,151,163,173,181,193,199,211,223,233,241,251,263,277,283,293,307,
%U A371694 317,331,337,353,367,379,389,401,409,421,433,449,463,467,479,491,503
%N 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.
%C A371694 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).
%e A371694 primes    2 3 5  7 11 13 17 19 23 29 31 37 41 43 ..  97 101 103 107 109 113 127
%e A371694 n         1 2 3  4  5  6     7  8  9    10    11 ..  18          19      20  21
%e A371694 a(n)      2 3 5  7 11 13    19 23 29    37    43 ..  97         107     113 127
%e A371694 m         0 0 0  0  0  0     1  1  1     2     3 ..   7           9      10  10
%e A371694 a(n)+n-m  3 5 8 11 16 19    25 30 37    45    51 .. 108         117     123 138
%e A371694 a(n+1)    3 5 7 11 13 19    23 29 37    43    47 .. 107         113     127 137
%o A371694 (Python)
%o A371694 from sympy import primerange, prevprime, nextprime; p = 2; b = 0
%o A371694 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
%Y A371694 Cf. A362527.
%K A371694 nonn
%O A371694 1,1
%A A371694 _Ya-Ping Lu_, Apr 03 2024