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.

A361690 Number of primes in the interval [2^n, 2^n + n].

Original entry on oeis.org

0, 2, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 0, 0, 3, 4, 0, 3, 0, 2, 1, 1, 3, 0, 0, 1, 0, 2, 1, 5, 1, 1, 2, 1, 0, 1, 2, 2, 2, 2, 1, 1, 2, 3, 0, 1, 3, 1, 0, 0, 1, 2, 2, 0, 3, 0, 2, 0, 0, 1, 3, 0, 1, 3, 0, 1, 2, 3, 1, 2, 2, 1, 1, 2, 3, 2, 4, 2, 2, 1, 2, 4, 1, 3, 0, 3, 2, 1, 2, 0
Offset: 0

Views

Author

Jean-Marc Rebert, Mar 20 2023

Keywords

Examples

			In the interval [2^1, 2^1 + 1] there are 2 primes (2 and 3). So a(1) = 2.
		

Crossrefs

Programs

  • Maple
    a:= n-> nops(select(isprime, [$2^n..2^n+n])):
    seq(a(n), n=0..100);  # Alois P. Heinz, Mar 20 2023
  • Mathematica
    Array[PrimePi[2^# + #] - PrimePi[2^# - 1] &, 50, 0] (* Michael De Vlieger, Mar 27 2023 *)
  • PARI
    a(n)=#primes([2^n,2^n+n])
    
  • Python
    from sympy import isprime
    def A361690(n): return sum(1 for p in range((1<Chai Wah Wu, Mar 27 2023

Formula

From Alois P. Heinz, Mar 20 2023: (Start)
a(n) = pi(2^n+n) - pi(2^n-1), pi = A000720.
a(n) = A143537(2^n+n,2^n-1). (End)