Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: (Golf): Sieve of Eratosthenes

by MeowChow (Vicar)
on May 20, 2001 at 00:45 UTC ( #81761=note: print w/ replies, xml ) Need Help??


in reply to (Golf): Sieve of Eratosthenes

Ok, how's 50 characters for the bonus:

sub sieve { grep!(map$_[$a*$_]++,1..$_[0]/($a=$_))[0],2..$_[0] }
update: Hmm, in my golfing frenzy, I seem to have increased the big-O back to that of the main problem, so I don't think this qualifies after all.
   MeowChow                                   
               s aamecha.s a..a\u$&owag.print


Comment on Re: (Golf): Sieve of Eratosthenes
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://81761]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-07-31 04:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (244 votes), past polls