login
A361690
Number of primes in the interval [2^n, 2^n + n].
1
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,2
LINKS
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)
EXAMPLE
In the interval [2^1, 2^1 + 1] there are 2 primes (2 and 3). So a(1) = 2.
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 *)
PROG
(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<<n)+1, (1<<n)+n+1, 2) if isprime(p)) if n != 1 else 2 # Chai Wah Wu, Mar 27 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Jean-Marc Rebert, Mar 20 2023
STATUS
approved