Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 musing on the Monastery: (3)
As of 2018-07-19 08:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (404 votes). Check out past polls.

    Notices?