OFFSET
1,4
EXAMPLE
a(1)=0 because are no primes in half-open interval [1*sqrt((1-1)/2), (1+1)*sqrt(1/2)),
a(2)=1 because prime 2 is in half-open interval [2*sqrt((2-1)/2), (2+1)*sqrt(2/2)),
a(3)=1 because primes 3 is in half-open interval [3*sqrt((3-1)/2),(3+1)*sqrt(3/2)),
a(4)=2 because primes 5,7 are in half-open interval [4*sqrt((4-1)/2), (4+1)*sqrt(4/2)).
MAPLE
with(numtheory);
f:=proc(n) local t1, t2, eps;
t1:=floor((n+1)*sqrt(n/2));
if t1 = (n+1)*sqrt(n/2) then t1:=t1-1; fi;
t2:=ceil(n*sqrt((n-1)/2));
eps:=0;
if isprime(t2) then eps:=1; fi;
pi(t1)-pi(t2)+eps;
end;
[seq(f(n), n=1..120)]; # N. J. A. Sloane, Apr 26 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Gerasimov Sergey, Apr 10 2012
STATUS
approved