Golfing Eratosthenes

On Wed, Aug 02, 2006 at 06:20:05PM +0900, William J. wrote:

definition of the array a, and do the whole thing with no semicolons.

p (2…100).inject([]){|a,n|a.any?{|i|n%i==0}?a:a<<n}

Of course, one might make a case for making that (2…99), shaving off a
byte, since we all know 100 isn’t prime. We could make that 99 lower,
but there’s no point if our point is golfing.