Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

RE: sieve of erothenes

by Adam (Vicar)
on Jul 01, 2000 at 03:05 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://20691]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-24 04:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found