Ruby: Simple prime number solution in Ruby