Definition:
The n-factor equals the sum of the absolute changes in oxidation number multiplied by the number of atoms undergoing that change:
$$n\mathrm{-factor} = \sum \bigl|\Delta \mathrm{O.N.}\bigr|\times N$$
where $$N$$ is the number of atoms whose oxidation number changes.
Example 1 (Redox): KMnO4 in acidic medium
Mn changes from +7 to +2, so $$\Delta\mathrm{O.N.}=5$$ and $$N=1$$,
$$n\mathrm{-factor}=5\times1=5$$
Example 2 (AcidβBase): H2SO4 in neutralization
Diprotic acid with 2 replaceable H+ ions,
$$n\mathrm{-factor}=2$$