from typing import Sequence


def digit_counts(n: int, base: int = 10) -> Sequence[int]:
    """Counts the occurrences of each possible digit in a number.

    Args:
        n: A positive integer value.
        base: The base in which ``n`` will be represented. Must be at least 2.

    Returns:
        An integer sequence of length ``base``, where each entry represents the
        number of times a digit from 0 to ``base - 1`` (in that order) appears
        in the given base representation of ``n``.
    """
    counts = [0] * base
    while n != 0:
        n, digit = divmod(n, base)
        counts[digit] += 1
    return counts