A098396 Number of primes that are not less than prime(n)-Log2(n) and not greater than prime(n)+Log2(n), where Log2=A000523.
1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 2, 2, 3, 2, 2, 2, 1, 2, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 2, 1, 2, 3, 3, 2, 2, 2, 1, 1, 1, 2, 2, 2, 3, 2, 1, 2, 4, 4, 3, 2, 2, 3, 3, 4, 2, 2, 3, 3, 3, 2, 2, 2, 1, 2, 2, 2, 3, 3, 3, 2, 3, 4, 4, 3, 1, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 3, 3, 3
Offset: 1
Keywords
Examples
a(10) = #{p prime: A098386(10) <= p <= A098387(10)} = = #{p prime: 26 <= p <= 32} = #{29,31} = 2.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
f:= proc(n) local p,d; p:= ithprime(n); d:= ilog2(n); numtheory:-pi(p+d)-numtheory:-pi(p-d-1) end proc: map(f, [$1..200]); # Robert Israel, Aug 13 2018
-
Mathematica
a[n_] := With[{p = Prime[n], d = BitLength[n]-1}, PrimePi[p+d] - PrimePi[p-d-1]]; Table[a[n], {n, 1, 200}] (* Jean-François Alcover, Feb 07 2023 *)