from typing import List


def to_factorial_base(n: int) -> List[int]:
    """
    Convert a nonnegative integer to its representation in the `factorial
    number system <https://en.wikipedia.org/wiki/Factorial_number_system>`_
    (represented as a list of digits in descending order of place value, not
    including the final zero digit sometimes appended for the :math:`0!` place)
    """
    if n < 0:
        raise ValueError(n)
    if n == 0:
        return [0]
    digits = []
    i = 1
    while n > 0:
        digits.append(n % (i + 1))
        i += 1
        n //= i
    digits.reverse()
    return digits