A145539 Number of numbers removed in each step of Eratosthenes's sieve for 10^6.
499999, 166666, 66666, 38094, 20778, 15983, 11283, 9502, 7434, 5646, 5098, 4136, 3617, 3356, 2982, 2575, 2261, 2143, 1910, 1775, 1700, 1553, 1460, 1354, 1244, 1195, 1171, 1130, 1109, 1074, 964, 937, 898, 886, 832, 820, 794, 763, 745, 719, 697, 689, 654
Offset: 1
Links
- Nathaniel Johnston, Table of n, a(n) for n = 1..168 (full sequence)
Programs
-
Maple
A145539:=Array([seq(0,j=1..168)]): lim:=10^6: p:=Array([seq(ithprime(j),j=1..168)]): for n from 4 to lim do if(isprime(n))then n:=n+1: fi: for k from 1 to 168 do if(n mod p[k] = 0)then A145539[k]:=A145539[k]+1: break: fi: od: od: seq(A145539[j],j=1..168); # Nathaniel Johnston, Jun 23 2011
-
Mathematica
f3[k_Integer?Positive, i_Integer?Positive] := Module[{f, m, r, p}, p = Transpose[{r = Range[2, i], Prime[r]}];f[x_] := Catch[Fold[If[Mod[x, #2[[2]]] == 0, Throw[m[ #2[[1]]] = m[ #2[[1]]] + 1], #1] &, If[Mod[x, 2] == 0, Throw[m[1] = m[1] + 1]], p]]; Table[m[n] = -1, {n, i}]; f /@ Range[k]; Table[m[n], {n, i}]];nn = 6; kk = PrimePi[Sqrt[10^nn]]; t3 = f3[10^nn, kk] (* Bob Hanlon (hanlonr(AT)cox.net) *)
Comments