'Finds the unranked Prufer sequence.
Examples
>>> from sympy.combinatorics.prufer import Prufer
>>> Prufer.unrank(0, 4)
Prufer([0, 0])'

@classmethod
def unrank(self, rank, n):

    (n, rank) = (as_int(n), as_int(rank))
    L = defaultdict(int)
    for i in range((n - 3), (-1), (-1)):
        L[i] = (rank % n)
        rank = ((rank - L[i]) // n)
    return Prufer([L[i] for i in range(len(L))])
