エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
Problem 5 - Project Eulerより 2520 is the smallest number that can be divided by each of the numb... Problem 5 - Project Eulerより 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest number that is evenly divisible by all of the numbers from 1 to 20? 2520は1から10の各数字で割り切れる数の中で最小のものである。 同様に1から20の全ての数字で割り切れる最小の数は何か。 素直に20より大きい数字を順に1から20で割って 割り切れるものを見つける def find_divisible(max) n = max loop do break n if divisible_all?(n, max) n