How this calculation works
Count the distinct trees on a fixed set of labeled vertices.
n^(n−2) for n ≥ 2A worked example
On five labels there are 5³ = 125 trees.
Good to know
The one-vertex graph counts as one tree.
Reference: NIST DLMF, Functions of Number Theory (opens in a new tab) ↗
Read the result
Count the distinct trees on a fixed set of labeled vertices.
The primary result is labeled “Labeled trees”. Keep the input definitions in view when comparing this result with another method.
Try a related calculation
The one-vertex graph counts as one tree.
For a related exercise, try the greatest common divisor.
A few questions, answered
How can I check the default inputs by hand?
On five labels there are 5³ = 125 trees.
Which rule does this calculator apply?
n^(n−2) for n ≥ 2