login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A098396 Number of primes that are not less than prime(n)-Log2(n) and not greater than prime(n)+Log2(n), where Log2=A000523. 3
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(n) = A000720(A098386(n)) - A000720(A098387(n)-1).
A098398(n) <= a(n) <= A098397(n) <= A097935(n).
EXAMPLE
a(10) = #{p prime: A098386(10) <= p <= A098387(10)} =
= #{p prime: 26 <= p <= 32} = #{29,31} = 2.
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 *)
CROSSREFS
Sequence in context: A026535 A080462 A194823 * A297773 A043532 A043557
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Sep 06 2004
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 28 13:20 EDT 2024. Contains 375507 sequences. (Running on oeis4.)