OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
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