Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 cooling their heels in the Monastery: (11)
As of 2015-07-29 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls