Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: (Golf): Sieve of Eratosthenes

by chipmunk (Parson)
on May 19, 2001 at 19:59 UTC ( #81731=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub sieve {
    my@p;@_=2..pop;{push@p,$p=shift;redo if@_=grep$_%$p,@_}@p
    }
    
  2. or download this
    sub sieve {
    my@p;@_=2..pop;{push@p,shift;redo if@_=grep$_%$p[-1],@_}@p
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2014-09-22 23:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (208 votes), past polls