This week's POTW is inspired by a recent XKCD.

Number systems like decimal, binary, and hexadecimal each have a fixed number of allowed digits in each place (10, 2, and 16, respectively), while “mixed-radix” systems like the 24-hour clock can have a different number of allowed digits in each place (24 hours, 60 minutes, and 60 seconds, for example). Counting works the same way in all of these systems: When incrementing the rightmost digit causes it to roll from its maximum value back to zero, we “carry” this overflow by incrementing the next digit to the left: 09 increments to 10 in base 10, and 00:00:59 increments to 00:01:00 on the clock.

In the factorial number system (not a prank), the Nth digit from the right has base N, and thus a maximum allowable digit of N−1. As a result, the rightmost digit is always 0, the digit to its left can be 0 or 1 (in good old base 2), the next digit can be 0, 1, or 2 (in base 3), and so on. This is called the factorial number system because the place value of the Nth digit is (N−1)!.

Let’s look at an example. Suppose a number is written 103210 in the factorial number system. What is this number in base 10? It’s 1(5!) + 0(4!) + 3(3!) + 2(2!) + 1(1!) + 0(0!), or 143. (Note that the numbers in bold are exactly the digits from the factorial number representation.)

What is the smallest number in the factorial number system that is divisible by the whole numbers from 1 through 5, while also containing all of the digits 0 through 5? (Note that this number can have more than one copy of any given digit.)

You can submit this number using the factorial number system or in base 10.