Sum multiples of 3 and 5: Difference between revisions
m
→{{header|Ruby}}
Line 873:
(1..g1).select{|x| x%n1==0 or x%n2==0}.collect{|x|
y = x+g1*g2
if y>n3 then
}.inject{|sum,x| sum+x}/2
end
|