Sieve of Eratosthenes: Difference between revisions

m
→‎wheel version: optimized for computing the square of J.
(→‎{{header|Python}}: Note on range vs xrange moved up. Most code shown in Python 3 compatable form. (GvR would like us to show it where possible to aid the migration).)
m (→‎wheel version: optimized for computing the square of J.)
Line 4,026:
if @.j then do; #=#+1 /*Prime? Then bump prime counter*/
say prime right(#,w) " ───► " right(j,w) /*show.*/
ifjj=j*j skip then iterate /*shouldcompute the topsquare of J. part be skipped?*/
if j*jjj>H then skip=1 /*indicate skipping if j > √ H. */
do m=j*jjj to H by j+j; @.m=0; end /*odd multiples.*/
end /*plain*/ /*[↑] strike odd multiples ¬prime*/
end /*j*/