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.

Showing 1-2 of 2 results.

A098396 Number of primes that are not less than prime(n)-Log2(n) and not greater than prime(n)+Log2(n), where Log2=A000523.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Sep 06 2004

Keywords

Examples

			a(10) = #{p prime: A098386(10) <= p <= A098387(10)} =
= #{p prime: 26 <= p <= 32} = #{29,31} = 2.
		

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 *)

Formula

a(n) = A000720(A098386(n)) - A000720(A098387(n)-1).
A098398(n) <= a(n) <= A098397(n) <= A097935(n).

A098398 Number of primes that are not less than prime(n)-Log2(Log2(prime(n))) and not greater than prime(n)+Log2(Log2(prime(n))), where Log2=A000523.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 06 2004

Keywords

Comments

a(n) = A000720(A098392(n)) - A000720(A098393(n)-1);
a(n) <= A098396(n) <= A098397(n) <= A097935(n);
a(n)<=2 for n<=6543; a(6544)=#{2^16+1=65537,65539,65543}=3.

Examples

			a(10) = #{p prime: A098392(10) <= p <= A098393(10)} =
= #{p prime: 27 <= p <= 31} = #{29,31} = 2.
		
Showing 1-2 of 2 results.