Jump to content

Sieve of Eratosthenes: Difference between revisions

m
m (→‎wheel version: optimized for computing the square of J.)
Line 3,924:
if tell then say right(#,w+20)th(#) 'prime ───► ' right(j,w)
if skip then iterate /*should the top part be skipped?*/
if jj=j*j>H then skip=1 /*indicatecompute skippingthe ifsquare of J. j > H. */
if jj>H do mthen skip=j1 /*jindicate toskipping Hif by j+j; @.m=0;> end H. /*odd multiples.*/
do m=jj to H by j+j; @.m=0; end /*odd multiples.*/
end /*plain*/ /*[↑] strike odd multiples ¬prime*/
end /*j*/
Cookies help us deliver our services. By using our services, you agree to our use of cookies.