The Smallest Number

Published by persolut in

Given a positive integer n, implement a function that finds the smallest number that is evenly divisible by the integers 1 through n inclusive. Return value as a string.

Examples

Smallest(1) ➞ "1"

Smallest(5) ➞ "60"

Smallest(10) ➞ "2520"

Smallest(20) ➞ "232792560"

Notes

You will need to cope with numbers larger than Int64.MaxValue (see Resources).

Watch a quick demo on how Edabit works.