I was trying to answer this question - how many labeled rooted trees with n nodes are there?

A quick search didn't find the answer (I'm sure a more detailed search would have). Then I had this idea - find the answer for small values of n, and look in the OEIS. I typed 1,2,9,64 in the search and quickly found the answer (which is n^(n-1) for those interested). I thought about it for a couple of minutes but still hadn't come up with an answer as to why this is true.

## 17 March 2008

### The On-Line Encyclopedia of Integer Sequences

Labels:
Computer Science,
Graphs

Subscribe to:
Post Comments (Atom)

## 3 comments:

The number of labeled trees on n nodes, which is n^{n-2} by Prüfer's theorem, times n for the selection of which label is the root.

Right you are, thanks :)

I'm curious, who is this?

What I immediately found in Wikipedia is the number of unrooted trees is n^{n-2}, but I didn't make the trivial jump to rooted trees.

It was me, didn't notice the option to leave a name instead of being anonymous.

Post a Comment