Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 studying the Monastery: (6)
As of 2014-07-25 09:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (170 votes), past polls