Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 browsing the Monastery: (10)
As of 2014-12-29 13:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (188 votes), past polls