If p=r=0, we have A=∅ so that μ(A)=0. In this case T(0,0)={∅} and ∣T(0,0)∣=1, which agrees with the formula.
Assume p≥r≥1. Add two two dummy vertices 0, n+1 to P such that 0 is joined to 1 and n is joined to n+1. Let
Π=(l1,m1,l2,m2,…,lk,mk,lk+1)
be an ordered (2k+1)-tuple of positive integers such that
l1+m1+l2+m2+⋯+lk+mk+lk+1=n+2.(∗)
(Thus Π is an ordered partition of n+2 into 2k+1 parts.) We obtain a subset A=A(Π) of V from this as follows: starting from the left end of the sequence ⟨0,1,2,…,n+1⟩, we omit the first l1 numbers; choose the next m1 numbers; omit the next l2 numbers; choose the next m2 numbers and so on alternately. Finally, we omit the last lk+1 numbers. (Observe, that l1≥1 and lk+1≥1 implies that the dummy vertices 0 and n+1 are not used at all.) The union of k chosen sets of numbers consisting of m1,m2,…,mk elements respectively is defined as A. We see that A⊆{1,2,3,…,n}. Conversely, any A⊆{1,2,3,…,n} gives rise to an ordered 2k+1 tuple of positive integers in a unique way; since 0∈/A and n+1∈/A, we have l1≥1 and lk+1≥1. Since the l's are positive, we see that G(A) has k components of vertex sizes m1,m2,…,mk. If u of these k numbers, say, mi1,mi2,…,miu are odd and the remaining v numbers, say, mj1,mj2,…,mjv are even, 0≤u,v≤k, then u+v=k, and O(G(A))=u. Thus μ(A)=m1+m2+⋯+mk+u. We count A for which μ(A)=2r, 1≤r≤n. Let mi1,mi2,…,miu be respectively equal to 2mi1′−1,2mi2′−1,…,2miu′−1 and mj1,mj2,…,mjv be equal to 2mj1′,2mj2′,…,2mjv′. Then
μ(A)=2mi1′+2mi2′+⋯+2miu′+2mj1′+2mj2′+⋯2mjv′=2r.
Thus we get
mi1′+mi2′+⋯+miu′+mj1′+mj2′+⋯mjv′=r.
The number of positive solutions of this is (k−1r−1). Also we have
l1+l2+⋯+lk+1=n+2−(2r−u)=n−2r+u+2.
The number of positive solutions to this is (kn−2r+u+1). Thus the number of positive solutions of (∗) with μ(A)=2r is
k≥1∑(k−1r−1)(kn−2r+u+1).
Since p+u=2r, we have
∣T(p,r)∣=k≥1∑(k−1r−1)(kn−2r+u+1)(uk).
as any u of the k m's may be chosen to be odd and the rest even, giving rise to the factor (uk). Using
(kn)(mk)=(mn)(n−kn−m),
we get
∣T(p,r)∣=(un−p+1)k≥1∑(k−1r−1)(n−p+1−kn−p+1−u)=(un−p+1)(n−pn−p−u+r)=(2r−pn−p+1)(n−pn−r)=(p−rn−r)(2r−pn−p+1);
where we have used Vander Monde identity.