Euler Project - Problem 1

Oct 09, 2009

# Project Euler: Problem 1
# Use Module:Enumerable
# Sum some numbers (5..10).inject { |sum,n| sum+n }
# find the sum of all multiples of 3 and 5 below 1000
puts (1...1000).select { |n| n % 3 == 0 or n % 5 ==0 }.inject { |sum,n| sum+n }