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
    }