Cayley's Formula

Theorem
The number of distinct labeled trees with $n$ nodes is $n^{n - 2}$.

Proof
Follows directly from Bijection between Prüfer Sequences and Labeled Trees.

This shows that there is a bijection between the set of labeled trees with $n$ nodes and the set of all Prüfer sequences of the form:
 * $\tuple {\mathbf a_1, \mathbf a_2, \ldots, \mathbf a_{n - 2} }$

where each of the $\mathbf a_i$'s is one of the integers $1, 2, \ldots, n$, allowing for repetition.

Since there are exactly $n$ possible values for each integer $\mathbf a_i$, the total number of such sequences is $\ds \prod_{i \mathop = 1}^{n - 2} n$.

The result follows from Equivalence of Mappings between Sets of Same Cardinality.