A083269 a(n) = pi(A052180(n)) = A000720(A052180(n)); subscript of last prime used in Eratosthenes sieve by which all composites between n-th and (n+1)th primes were excluded.
0, 1, 1, 2, 1, 2, 1, 2, 3, 1, 3, 2, 1, 2, 4, 3, 1, 3, 2, 1, 4, 2, 3, 4, 2, 1, 2, 1, 2, 5, 2, 4, 1, 5, 1, 3, 4, 2, 6, 3, 1, 5, 1, 2, 1, 5, 6, 2, 1, 2, 3, 1, 6, 5, 4, 3, 1, 3, 2, 1, 7, 6, 2, 1, 2, 7, 3, 5, 1, 2, 3, 8, 4, 6, 2, 3, 7, 2, 6, 4, 1, 4, 1, 8, 2, 3, 5, 2, 1, 2, 5, 6, 2, 7, 2, 3, 5, 1, 9, 3, 8, 6, 3, 1, 3
Offset: 1
Keywords
Examples
Of composites between the 24th and 25th primes (89, 97), the least prime divisors are {2,7,2,3,2,5,2}. The largest of these is 7. This means that pi(7)=4 steps in prime sieving are required to sweep out all composites between 89 and 97: {90,92,94,96}, {93}, {95}, and {91} were excluded in the 1st, 2nd, 3rd, and 4th steps, respectively. So a(24)=4.
Programs
-
Mathematica
ffi[x_] := Flatten[FactorInteger[x]] lf[x_] := Length[FactorInteger[x]] ba[x_] := Table[Part[ffi[x], 2*w-1], {w, 1, lf[x]}] mi[x_] := Min[ba[x]] Table[PrimePi[Max[Table[mi[ba[w]], {w, Prime[j]+1, -1+Prime[j+1]}]]], {j, 1, 30}]