Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re (tilly) 1: (Golf): Sieve of Eratosthenes

by tilly (Archbishop)
on May 19, 2001 at 23:08 UTC ( #81755=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub p{
    %p=@_=3..1+pop;@p{2,map$f*$_,@_}=$f=$_ for@_;grep$p{$_},2,@_
    }
    
  2. or download this
    sub p{
    2,grep{$f=$_,@p{map$f*$_,3..$_[0]/$f}=0if$p{$_}}%p=3..1+$_[0]
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://81755]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2017-02-23 17:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (350 votes). Check out past polls.