From: "Kroeger, Simon (ext)" Date: 2006-08-02T20:51:22+09:00 Subject: Re: golfing Eratosthenes > From: Robert Dober [mailto:robert.dober@gmail.com] > Sent: Wednesday, August 02, 2006 1:26 PM > > On 8/2/06, Paul Battley wrote: > > > > On 02/08/06, Robert Dober wrote: > > > Enumerations, all the way ;) > > > > > > p (2..100).select{|d|!(2..d-1).find{|c|d%c==0}} > > > > You can shave a byte off: > > > > p (2..100).reject{|d|(2..d-1).find{|c|d%c==0}} p (2..100).select{|d|(2...d).all?{|c|d%c>0}} But it has nothing to do with Eratosthenes anymore... cheers Simon