OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
EXAMPLE
a(1) = 2 because two primes in the range [1^2-1, 1^2+1], a(2) = 3 because 2, 3 and 5 are in range [2^2-2, 2^2+2].
MAPLE
with(numtheory); f:=n->pi(2^n+n)-pi(2^n-n-1); [seq(f(n), n=0..20)];
# second Maple program:
a:= n-> add(`if`(isprime(t), 1, 0), t=2^n-n..2^n+n):
seq(a(n), n=0..100); # Alois P. Heinz, Sep 13 2011
MATHEMATICA
Table[PrimePi[2^n + n] - PrimePi[2^n - n - 1], {n, 0, 40}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Jul 01 2011
EXTENSIONS
Corrected with Maple program. - N. J. A. Sloane, Jul 11 2011
Corrected name and added terms up to a(40). - T. D. Noe, Jul 12 2011
More terms from Alois P. Heinz, Sep 13 2011
STATUS
approved