Skip to content

Instantly share code, notes, and snippets.

@noahbass
Created January 21, 2015 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noahbass/dcd20e903f1753836ba3 to your computer and use it in GitHub Desktop.
Save noahbass/dcd20e903f1753836ba3 to your computer and use it in GitHub Desktop.
<?php
function main()
{
$count = 3;
$count2 = 1;
while(True) {
$isprime = True;
for($i = 2; $i <= 10; $i++) {
if($count % $i === 0) {
$isprime = False;
}
}
if($isprime) {
echo " prime = " . $count . " " . $count2 . " primes generated\n";
$count2 += 1;
}
$count += 1;
}
}
main()
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment