A337788 The number of primes between n exclusive and n+primepi(n) inclusive.
0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 4, 4, 5, 5, 4, 4, 4, 4, 4, 4, 5, 5, 4, 4, 4, 5, 4, 4, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 4, 5, 5, 6, 6
Offset: 1
Keywords
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
- Ya-Ping Lu, Lower Bounds for the Number of Primes in Some Integer Intervals
- Laurențiu Panaitopol, Intervals containing prime numbers, NNTDM 7 (2001), 4, pp. 111-114.
Programs
-
Mathematica
Table[Count[Range[n+1,n+PrimePi[n]],?PrimeQ],{n,90}] (* _Harvey P. Dale, Aug 28 2024 *)
-
PARI
a(n) = primepi(n+primepi(n)) - primepi(n); \\ Michel Marcus, Oct 27 2020
-
Python
from sympy import primepi for n in range(1, 101): pi = primepi(n) a = primepi(n + pi) - pi print(a)
Comments