How this calculation works
Recover the number of leaves of a tree from counts of vertices of degrees two through four.
Leaves = 2 + Σ(d−2) n_d over internal verticesA worked example
Two degree-three vertices and one degree-four vertex give 2+2+2 = 6 leaves.
Good to know
The tree has at least two vertices and no vertex of degree above four.
Reference: NIST DLMF, Functions of Number Theory (opens in a new tab) ↗
Read the result
Recover the number of leaves of a tree from counts of vertices of degrees two through four.
The primary result is labeled “Leaves”. Keep the input definitions in view when comparing this result with another method.
Try a related calculation
The tree has at least two vertices and no vertex of degree above four.
For a related exercise, try the greatest common divisor.
A few questions, answered
How can I check the default inputs by hand?
Two degree-three vertices and one degree-four vertex give 2+2+2 = 6 leaves.
Which rule does this calculator apply?
Leaves = 2 + Σ(d−2) n_d over internal vertices