login
Number of primes between n^2 and (n+1/6)^2.
1

%I #12 Jan 03 2018 06:58:19

%S 0,0,0,1,0,1,0,0,1,2,0,0,1,2,2,1,1,0,1,1,1,2,0,1,1,2,1,1,0,1,2,2,3,1,

%T 2,4,2,3,2,4,1,1,1,1,3,2,2,2,2,1,2,4,1,2,2,1,4,2,2,3,3,4,1,2,4,3,2,3,

%U 1,3,2,2,3,3,3,4,2,3,3,1,5,2,3,3,5,2,5,3,4,4,5,1,3,6,4,4,7,5,5,2,2,3,4,3,4

%N Number of primes between n^2 and (n+1/6)^2.

%H Robert Israel, <a href="/A089616/b089616.txt">Table of n, a(n) for n = 1..10000</a>

%p seq(numtheory:-pi(floor((n+1/6)^2))-numtheory:-pi(n^2), n=1..200); # _Robert Israel_, Jan 02 2018

%t Table[PrimePi[(n+1/6)^2]-PrimePi[n^2],{n,110}] (* _Harvey P. Dale_, Sep 17 2013 *)

%o (PARI) pbetweensq2(n) = { for(x=1,n, c=0; for(y=floor(x)^2,(x+1/6)^2, if(isprime(y),c++) ); print1(c",") ) }

%o (PARI) a(n) = primepi((n+1/6)^2) - primepi(n^2); \\ _Michel Marcus_, Jan 03 2018

%K easy,nonn,look

%O 1,10

%A _Cino Hilliard_, Dec 31 2003