Skip to content

Instantly share code, notes, and snippets.

@brewster1134
Created March 31, 2014 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brewster1134/9901348 to your computer and use it in GitHub Desktop.
Save brewster1134/9901348 to your computer and use it in GitHub Desktop.
2520
# What's the smallest number divisible be all of 1, 2, 3, 4, 5, 6, 7, 8, and 9?
require 'colorize'
def check_num num
(num % 9 == 0) && (num % 8 == 0) && (num % 7 == 0) && (num % 6 == 0)
end
multiple = 10
current_num = multiple
until check_num current_num
puts "#{current_num} NO...".red
current_num += multiple
end
puts "#{current_num} YES!!!".green
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment