Implements the Prüfer sequence in javascript, for space-efficient representation of trees using a unique sequence. Useful for generating random trees of data.