I did some searching and was not able to find any information regarding this implementation versus every other one I have seen.
function sieve($top)
{
for($i = 11; $i<$top; $i+=2)
{
if($i % 3 == 0 || $i % 5 == 0
|| $i % 7 == 0)
{
continue;
}
echo "$i <br />";
}
}
Yeah I know it just prints it out, but that’s not the important part. What is the major pitfall whether it be time or other?
EDIT: Are there any other issues beyond scalability? Also again thanks for the comments about moving forward with prime finding.
The major pitfall of this is it doesn’t scale. Once the numbers are large enough anything will be returned. You list of modulus excluders needs to grow with the search.