Labelled spanning trees of $K_n-e$ Let $e$ be an edge of $K_n$- the complete graph on $n$ vertices.
Prove that the number of labelled spanning trees of $K_n-e$ is $(n-2)n^{n-3}$.
I think the answer lies in using some modified form of Prüfer's sequence but I can't quite nail it.
 A: You know that $K_n$ has $n^{n-2}$ spanning trees, right? You want to find out how many of those spanning trees do not contain the edge $e.$ You can do that by finding the number of spanning trees that do contain $e$ and subtracting that from $n^{n-2}.$
By symmetry, each edge of $K_n$ is in the same number of spanning trees, call that number $t.$ Let $p$ be the number of pairs $(T,e)$ where $T$ is a spanning tree of $K_n$ and $e$ is an edge of $T.$
On the one hand, $p=\binom n2t,$ since there are $\binom n2$ edges and each edge is in $t$ spanning trees.
On the other hand, $p=n^{n-2}(n-1),$ since there are $n^{n-2}$ spanning trees and each spanning tree contains $n-1$ edges.
Solving the equation $\binom n2t=n^{n-2}(n-1)$ for $t,$ we get $t=2n^{n-3}.$
Finally, the number of spanning trees of $K_n-e$ is
$$n^{n-2}-2n^{n-3}=\boxed{(n-2)n^{n-3}}.$$
A: The last entry in the Prüfer code is one of the two highest labels if and only if the edge between them exists, so the number of trees with that edge is $2n^{n-3}$.
A: Recall Cayley's theorem that there are $n^{n-1}$ rooted labeled trees.
Introduce
$$ T(z) = \sum_{n\ge 1} n^{n-1} \frac{z^n}{n!}.$$
Note also that for the corresponding combinatorial class $\mathcal{T}$
we have that
$$\def\textsc#1{\dosc#1\csod}
\def\dosc#1#2\csod{{\rm #1{\small #2}}}
\mathcal{T} = \mathcal{Z} \times \textsc{SET}(\mathcal{T}).$$
This gives the functional equation
$$T(z) = z \exp T(z).$$
Now the spanning trees of $K_n$ that do not pass through the edge from
vertex one to vertex two produce a combinatorial class $\mathcal{F}$.
There is a  unique path from one to two onto which the ordering of these
two nodes induces a direction, with the start node one and the end node
two. The nodes on this path all  have some set of trees attached to them,
i.e. are themselves rooted  trees  (root is on the path), forming a
sequence $\textsc{SEQ}_{\ge 1}(\mathcal{T})$ of  trees. The nodes one and
two also have a set of trees attached to them. This gives  the
combinatorial class
$$\mathcal{F} = \textsc{SEQ}_{\ge 1}(\mathcal{T}) \times
\textsc{SET}(\mathcal{T}) \times \textsc{SET}(\mathcal{T}).$$
We get for the corresponding EGF that it is
$$F(z) = \frac{T(z)}{1-T(z)} \exp(T(z))^2.$$
As this does not include nodes one and two the quantity $(n-2)!
[z^{n-2}] F(z)$ is what we seek to obtain. When we construct the tree
we relabel the $n-2$ nodes from $\mathcal{F}$ with the values $3$ to $n$
respecting the ordering in the instance from $\mathcal{F}$ (i.e. add
two to the value of each node).
We are now ready to extract coefficients from $F(z).$ We find
$$n! [z^n] F(z) =
\frac{n!}{2\pi i}
\int_{|z|=\varepsilon}
\frac{1}{z^{n+1}} \frac{T(z)}{1-T(z)} \exp(T(z))^2 \; dz.$$
We put $T(z) = w$ and get from the functional equation that $z= w
\exp(-w)$ so that $dz = (\exp(-w)-w\exp(-w)) \; dw = \exp(-w) (1-w) \; 
dw$ and we obtain
$$\frac{n!}{2\pi i}
\int_{|w|=\gamma}
\frac{\exp((n+1)w)}{w^{n+1}}
\frac{w}{1-w} \exp(w)^2 \exp(-w) (1-w) \; dw
\\ = \frac{n!}{2\pi i}
\int_{|w|=\gamma}
\frac{\exp((n+2)w)}{w^{n}} \; dw.$$
This works out to $n! \frac{(n+2)^{n-1}}{(n-1)!} = n (n+2)^{n-1}.$
Keeping in mind that we require the coefficient at $[z^{n-2}]$ we find at
last the closed form
$$\bbox[5px,border:2px solid #00A000]{
(n-2) \times n^{n-3}.}$$
Remark. This proof is based on material at
OEIS A071720. The combinatorial class
notation is from Analytic Combinatorics by Flajolet and  Sedgewick.
