Function to print the nodes with prime degree in the tree whose Prufer sequence is given
function PrimeDegreeNodes ( prufer , n ) { let nodes = n + 2 ; let prime = new Array ( nodes + 1 ) ; prime . fill ( true ) ; SieveOfEratosthenes ( prime , nodes + 1 ) ;