The $n$-factor of a compound in a reaction gives the number of moles of electron lost or gained by it (during oxidation and reduction respectively) per mole of the given compound. In a disproportionation reaction, the compound undergoing both the oxidation and reduction is the same.
It is important to understand that the $n$-factor depends not just on the change in oxidation state of the element but also the number of moles of the element undergoing that change.
This is the reason why we cannot simply take the average of the two $n$-factors as the $n$-factor of the disproportionate. It is necessary to also consider how much of the reactant is getting oxidised and how much of it is getting reduced, something along the lines of a weighted mean.
It is quite simple to derive the expression you have found for the $n$-factor of a disproportionated compound. Consider the following general reaction:
$$\ce{nA -> xB + $(n - x)$C}$$
Where $x$ moles of $\ce{A}$ (for which $n$-factor is to be calculated) oxidises to $\ce{B}$ and the rest of it reduces to give $\ce{C}$. Let the $n$-factors for the oxidation and reduction respectively be $n_1$ and $n_2$. Which means $n_1 x$ moles of electrons go into oxidation, and $(n - x)n_2$ moles into reduction.
We have 2 equations: one by conservation of electrons,
$$\begin{align*}
n_1 x &= n_2(n - x) \\[7pt]
\implies x &= \frac{n_2\cdot n}{n_1 + n_2}
\end{align*}$$
and the other from the definition of $n$-factor:
$$\begin{align*}
n_f &= \frac{\text{moles of electrons transferred}}{\text{moles of reactant}} \\
&= \frac{n_1 x}{n} \\
&= \frac{n_1 n_2}{n_1 + n_2}
\end{align*}$$
An interesting observation here is that upon simplifying the obtained equation, you get the formula for the equivalent resistance of resistors connected parallelly in an electric circuit. The correspondence between them is intuitive.
$$ \frac{1}{n_f} = \frac{1}{n_1} + \frac{1}{n_2} $$