Sieve of Pritchard: Difference between revisions
m
Capitalization fix.
(→{{header|AppleScript}}: Replaced my 2 previous scripts with a new one.) |
m (Capitalization fix.) |
||
Line 8:
For example, the second-order wheel has circumference 6 (the product of the first two primes, 2 and 3) and is marked only at the numbers between 1 and 6 that are not multiples of 2 or 3, namely 1 and 5. As this wheel is rolled along the number line, it will pick up only numbers of the form 6k+1 or 6k+5 (that is, n where n mod 6 is in {1,5}). By the time it stops at 30 (2x3x5) it has added only 8 of the numbers between 6 and 30 as candidates for primality. Those that are multiples of 5 (only 2: 1*5 and 5*5) are obtained by multiplying the members of the second-order wheel. Removing them gives the next wheel, and so on.
[https://www.youtube.com/watch?v=GxgGMwLfTjE
;Task:
|