Function to print the nodes with prime degree in the tree whose Prufer sequence is given
def PrimeDegreeNodes ( prufer , n ) : NEW_LINE INDENT nodes = n + 2 NEW_LINE prime = [ True ] * ( nodes + 1 ) NEW_LINE SieveOfEratosthenes ( prime , nodes + 1 ) NEW_LINE DEDENT