https://projecteuler.net/problem=5
gcdが使えますね。
# e005.mojo from math import gcd import sys fn lcm(n: Int, m: Int) -> Int: return n // gcd(n, m) * m fn f(N: Int) -> Int: var m: Int = 1 for n in range(1, N+1): m = lcm(m, n) return m fn main() raises: let args = sys.argv() let N = atol(args[1]) print(f(N))