Guest User

Untitled

a guest
Feb 26th, 2012
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  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}"
Add Comment
Please, Sign In to add comment