login
Number of numbers removed in each step of Eratosthenes's sieve for 10^4.
23

%I #17 Feb 23 2019 19:51:45

%S 4999,1666,666,380,207,159,110,94,76,59,56,46,41,37,33,27,23,21,17,15,

%T 12,9,8,6,3

%N Number of numbers removed in each step of Eratosthenes's sieve for 10^4.

%C Number of steps in Eratosthenes's sieve for 10^n is A122121(n).

%C Number of primes less than 10^4 is 10^4 - (sum all of numbers in this sequence) - 1 = A006880(4).

%p A145540:=Array([seq(0,j=1..25)]): lim:=10^4: p:=Array([seq(ithprime(j),j=1..25)]): for n from 4 to lim do if(isprime(n))then n:=n+1: fi: for k from 1 to 25 do if(n mod p[k] = 0)then A145540[k]:=A145540[k]+1: break: fi: od: od: seq(A145540[j],j=1..25); # _Nathaniel Johnston_, Jun 23 2011

%t 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 = 4; kk = PrimePi[Sqrt[10^nn]]; t3 = f3[10^nn, kk] (* Bob Hanlon (hanlonr(AT)cox.net) *)

%Y Cf. A006880, A122121, A145532-A145540.

%K fini,full,nonn

%O 1,1

%A _Artur Jasinski_ with assistance from Bob Hanlon (hanlonr(AT)cox.net), Oct 14 2008