The formula for degrees of unsaturation is:
$$1+ \frac{1}{2} \sum ( n_i (v_i-2))$$
$v_i$ = valency of atom
$n_i$ = number of atoms with that valency
Could someone explain how the formula works, and why divalent atoms don't contribute to unsaturation (as evident from the formula).