23 lines
307 B
Ruby
23 lines
307 B
Ruby
|
def multipleUpTo20
|
||
|
divisible = nil
|
||
|
i = 2
|
||
|
while !divisible
|
||
|
numFound = true
|
||
|
puts "checking #{i}"
|
||
|
for j in (2..20)
|
||
|
if !(i % j == 0)
|
||
|
numFound = false
|
||
|
end
|
||
|
end
|
||
|
if numFound
|
||
|
return i
|
||
|
end
|
||
|
i += 1
|
||
|
end
|
||
|
end
|
||
|
|
||
|
puts multipleUpTo20
|
||
|
|
||
|
|
||
|
2*3*2*5*7*2*3*11*13*2*17*19
|