A229989 Number of primes in the interval [floor(n/2), floor(3n/2)].
0, 2, 2, 3, 4, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 7, 7, 7, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 15, 16, 16, 16, 17, 18, 18, 18
Offset: 1
Examples
a(5) = 4 counts the primes in the interval [2,7].
Links
- Nathaniel Johnston, Table of n, a(n) for n = 1..10000
Programs
-
Maple
with(numtheory): A229989 := proc(n) return pi(floor((3/2)*n))-pi(floor(n/2)-1): end proc: seq(A229989(n), n=1..75); # Nathaniel Johnston, Oct 11 2013
-
Mathematica
z = 1000; c[n_] := PrimePi[Floor[3 n/2]] - PrimePi[Floor[n/2]-1]; t = Table[c[n], {n, 1, z}]; (* A229989 *) Flatten[Position[Differences[t], -1]] (* A076274? *) Flatten[Position[Differences[t], 1]] (* A229990 *)
Comments