class_docstr: The Prufer correspondence is an algorithm that describes the
  bijection between labeled trees and the Prufer code. A Prufer
  code of a labeled tree is unique up to isomorphism and has
  a length of n - 2.
  
  Prufer sequences were first used by Heinz Prufer to give a
  proof of Cayley's formula.
  
  References
  ==========
  
  .. [1] https://mathworld.wolfram.com/LabeledTree.html
class_docstr_tok: ["The","Prufer","correspondence","is","an","algorithm","that","describes","the","bijection","between","labeled","trees","and","the","Prufer","code",".","A","Prufer","code","of","a","labeled","tree","is","unique","up","to","isomorphism","and","has","a","length","of","n","-","2",".","Prufer","sequences","were","first","used","by","Heinz","Prufer","to","give","a","proof","of","Cayley","'s","formula",".","References","==========","..","[","1","]","https",":","\/\/mathworld.wolfram.com\/LabeledTree.html"]
docstr: Finds the unranked Prufer sequence.
  
  Examples
  ========
  
  >>> from sympy.combinatorics.prufer import Prufer
  >>> Prufer.unrank(0, 4)
  Prufer([0, 0])
docstr_tok: ["Finds","the","unranked","Prufer","sequence",".","Examples","========",">",">",">","from","sympy.combinatorics.prufer","import","Prufer",">",">",">","Prufer.unrank","(","0",",","4",")","Prufer","(","[","0",",","0","]",")"]
code: def unrank(self, rank, n):
      """Finds the unranked Prufer sequence.
  
      Examples
      ========
  
      >>> from sympy.combinatorics.prufer import Prufer
      >>> Prufer.unrank(0, 4)
      Prufer([0, 0])
  
      """
      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))])
  
imports: from sympy.core import Basic
  from sympy.core.containers import Tuple
  from sympy.tensor.array import Array
  from sympy.core.sympify import _sympify
  from sympy.utilities.iterables import flatten, iterable
  from sympy.utilities.misc import as_int
  from collections import defaultdict
label_desc: Use image node_id 10 for calling the Prufer obj's underlying member method code with example usage: obj.unrank(rank, n) and returns: Prufer