Sieve of Pritchard: Difference between revisions

m
Line 37:
set {oldCircumference, circumference} to {missing value, 2}
set prime to 1
repeat until (oldCircumferenceprime =* prime > limit)
set o's oldWheel to o's wheel's numbers
set prime to o's oldWheel's second item
Line 78 ⟶ 79:
set {oldCircumference, circumference} to {missing value, 2}
set prime to 1
repeat until (oldCircumferenceprime =* prime > limit)
set o's oldWheel to o's wheel's numbers
set prime to o's oldWheel's second item
Line 86 ⟶ 88:
if (circumference > limit) then set circumference to limit
repeat with n from (oldCircumference + 1) to circumference
if (o's wheel's item ((n - 1) mod oldCircumference + 1) is not missing value) then ¬
set o's wheel's item n to n
end if
end repeat
repeat with this in o's oldWheel
Line 115 ⟶ 116:
end makeList
 
sieveOfPritchard(1000000150)</syntaxhighlight>
 
=={{header|C#|CSharp}}==
557

edits