in reply to (tye)Re3: (Golf): Sieve of Eratosthenes
in thread (Golf): Sieve of Eratosthenes
And almost a decade later I was randomly looking at this, and realized that it could be made shorter still.
Never give up on that last optimization!sub sieve3 { grep{@_[map$a*$_,2..@_/($a=$_)]=0if$_[$_]>1}@_=0..pop }
In Section
Meditations