操作
Problem 5¶
Smallest Multiple¶
$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 positive number that is evenly divisible (divisible with no remainder) by all of the numbers from $1$ to $20$?
最小の倍数¶
2520 は 1 から 10 の数字の全ての整数で割り切れる数字であり, そのような数字の中では最小の値である.
では, 1 から 20 までの整数全てで割り切れる数字の中で最小の正の数はいくらになるか.
#!r6rs
#!chezscheme
(import (chezscheme))
(define answer-5
(let ([n (* 11 13 15 16 17 19)])
(let loop ([i n])
(if (and
(zero? (mod i 12))
(zero? (mod i 14))
(zero? (mod i 18))
(zero? (mod i 20)))
i
(loop (+ i n))))))
(printf "5: ~D~%" answer-5)
Noppi が2023/12/27に更新 · 3件の履歴