SHARE
TWEET

Untitled

a guest Feb 26th, 2012 12 Never
  1. require './integer'
  2. require 'prime'
  3.  
  4. limit  = ARGV.first.to_i
  5. method = ARGV.last.to_sym
  6.  
  7. sum = (2...limit).select(&method).inject :+
  8.  
  9. puts "sum(primes < #{limit}) = #{sum}"
RAW Paste Data
Top