def reverseMnIds(nMax):
    """Generate reverse indexes according to stacked coefficients of orders m up
    to nMax.

    Parameters
    ----------
    nMax : (int)
        Maximum degree of coefficients reverse indexes to be returned. n >= 0

    Returns
    -------
    rev_ids : (int), array_like
        0, 3, 2, 1, 8, 7, 6, 5, 4, ...
    """
    m_ids = list(range(nMax * (nMax + 2) + 1))
    for o in range(nMax + 1):
        id_start = o ** 2
        id_end = id_start + o * 2 + 1
        m_ids[id_start:id_end] = reversed(m_ids[id_start:id_end])
    return m_ids