Skip to content

Instantly share code, notes, and snippets.

@hrs113355
Created July 2, 2015 10:00
Show Gist options
  • Save hrs113355/3e9913e03e37b96310d1 to your computer and use it in GitHub Desktop.
Save hrs113355/3e9913e03e37b96310d1 to your computer and use it in GitHub Desktop.
math summer hw
lcm = 1.lcm(2).lcm(3).lcm(4).lcm(6).lcm(7).lcm(8).lcm(9)
def check(num)
s = num.to_s
if s.include? "5"
return false
end
[1,2,3,4,6,7,8,9].each do |i|
if ! s.include? i.to_s
return false
end
end
true
end
(1..100000000).each do |i|
if check(lcm * i)
puts lcm * i
break
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment