Nitrogen form three bonds, so an organonitrogen compound has one more hydrogen than a related hydrocarbon; we therefore subtract the number of nitrogen from the number of hydrogens to arrive at the equivalent hydrocarbon formula. Again, you can convince yourself of this by seeing what happens when a nitrogen atom is inserted into an alkane bond: C-C become C-NH-C or C-H becomes C-NH2, meaning that one additional hydrogen atom has been added. We must therefore subtract this extra hydrogen atom to arrive at the equivalent hydrocarbon formula. For example, the formula C5H9N is equivalent to C5H8 and thus has two degrees of unsaturation.