All pastes #738657 Raw Edit

Someone

public ruby v1 · immutable
·published 2007-10-16 15:12 UTC
rendered paste body
#The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.#Find the sum of all the primes below one million.def getsum  @sum=0  a=(2..1_000_000).to_a  while a.size>0    @sum+=(pr=a[0])    a.reject! {|k| k%pr==0}    end  end  require 'benchmark'Benchmark.bm(30){|x|   x.report('results of getsum:') {getsum} }puts @sum