Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

RE: sieve of erothenes

by Adam (Vicar)
on Jul 01, 2000 at 03:05 UTC ( #20691=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    @_=(1);
    L:for(2..100)
    ...
       push @_,$_
    }
    print join(" ",@_),"\n";
    
  2. or download this
    sub Adam () 
    { @_=(1);L:for(2..100){$i=@_;while(--$i){next L unless $_%$_[$i]}push 
    +@_,$_} @_ }
    sub Maverick ()
    { for(1..100){push @_,$_;for(@_[1..($#_-1)]){pop @_ and last unless $_
    +[-1]%$_}} @_ }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2014-09-16 05:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (156 votes), past polls