I have written here before on the idea of degrees of unsaturation, and I am going to do it again. A carbon chain of 3 carbons that are fully saturated has a formula of #C_3H_8#; that is the number of hydrogen atoms is equal to #2n+2#, when #n# is the number of carbon atoms. Propane is of course a saturated hydrocarbon. Each 2 hydrogens LESS than #2n+2# represents 1 degree of unsaturation, which represents A DOUBLE BOND OR A RING.
For propyne, the saturated carbon chain would #C_3H_8#, but here the triple bond counts for #2""^@# of unsaturation, and hence the formula is #C_3H_4#. Both propene and cylcopropane (1 olefinic bond OR 1 ring, #1""^@# of unsaturation) have the formula #C_3H_6#.