hdb recently pointed out that I had misremembered how the Sieve of Eratosthenes works so now I'm having another go. Not all that obfu'd but moderately golfed.
$m=250;for(2..$m){for($a=$_*2;$a<=$m;$a+=$_){$c[$a]++}print"$_,"x!$c[$_]}
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: This One's a Sieve
by Athanasius (Archbishop) on Apr 01, 2015 at 15:27 UTC | |
by danaj (Friar) on May 07, 2015 at 16:13 UTC | |
by Anonymous Monk on May 07, 2015 at 19:03 UTC | |
Re: This One's a Sieve
by ambrus (Abbot) on Apr 02, 2015 at 10:45 UTC | |
Re: This One's a Sieve
by Grimy (Pilgrim) on May 07, 2015 at 14:56 UTC |
Back to
Obfuscated Code