Oxygen forms two bonds, so it doesn't affect the formula of an equivalent hydrocarbon and can be ignored when calculating the degree of unsaturation. You can convince yourself of this by seeing what happens when an oxygen atom is inserted into an alkane bond. C-C become C-O-C or C-H become C-O-H, and there is no change in the number of hydrocarbon formula C5H8 and thus has degrees of unsaturation.