A217564 Number of primes between prime(n)/2 and prime(n+1)/2.
0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 2, 0, 1, 0, 2, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 2, 2, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 2, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1
Offset: 1
Keywords
Examples
a(30) = 2 because there are two primes between prime(30)/2 [=113/2] and prime(31)/2 [=127/2]; i.e., the numbers 59 and 61.
Links
- Hans Havermann, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Mathematica
q = 2; Table[p = q; q = NextPrime[p]; Length[Position[PrimeQ[Range[p + 1, q - 1, 2]/2], True]], {105}] Table[PrimePi[Prime[n + 1]/2] - PrimePi[Prime[n]/2], {n, 105}] (* Alonso del Arte, Oct 08 2012 *)
Formula
a(n) = pi(prime(n + 1)/2) - pi(prime(n)/2), where pi is the prime counting function and prime(n) is the n-th prime.
The average order of a(n) is 1/2, that is, a(1) + a(2) + ... + a(n) ~ n/2. - Charles R Greathouse IV, Oct 09 2012
Comments