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”).

A154099
Maximal number of primes in intervals of size n containing the n-th prime.
1
1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 9, 10, 11, 11, 11, 11, 11, 11, 12, 12, 13, 13, 13, 13, 14, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15
OFFSET
1,2
COMMENTS
a(n) = Max(#{p: p prime and prime(n)-n+k+1<=p<=prime(n)+k}: 0<=k<n).
LINKS
EXAMPLE
a(10) = Max{#{23,29,31}, #{29,31}, #{29,31,37}} = 3;
a(12) = Max{#{29,31,37}, #{31,37,41,43}, #{37,41,43,47}} = 4.
PROG
(PARI) a(n) = my(p=prime(n)); vecmax(vector(n, k, #select(isprime, vector(n, i, prime(n)+k-n+i-1)))); \\ Michel Marcus, Nov 12 2023
CROSSREFS
Sequence in context: A002266 A075249 A008648 * A105511 A187183 A027868
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jan 05 2009
STATUS
approved