def mixed_radix_to_base_10(x, b):
    """Convert the `mixed radix`_ integer with digits `x` and bases `b` to base 10.

    Args:
        x (list): a list of digits ordered by increasing place values
        b (list): a list of bases corresponding to the digits

    Examples:
        Generally, the base 10 representation of the mixed radix number :math:`x_n\ldots x_1` where :math:`x_i` is a digit in place value :math:`i` with base :math:`b_i` is

        .. math::

            \sum_{i=1}^nx_i\prod_{j=i+1}^nb_j = x_n + b_nx_{n-1} + b_nb_{n-1}x_{n-2} + \cdots + b_n\cdots b_2x_1

        Convert 111 with bases :math:`(b_1,b_2,b_3)=(2,3,4)` to base 10:

        >>> from fem.discrete.combinatorics import mixed_radix_to_base_10
        >>> mixed_radix_to_base_10([1,1,1], [2,3,4])
        17

    .. _mixed radix:
        https://en.wikipedia.org/wiki/Mixed_radix

    """
    res = x[0]
    for i in range(1, len(x)):
        res *= b[i]
        res += x[i]
    return res