If one mole of a hydrocarbon contains 4g of hydrogen and its molar mass is 40 g/mol. what is the homologous series of the compound?

So % H = (4/40)*100 = 10%

Then carbon must be 90%.
mols C = 90/12 = 7.5
mols H = 10/1 = 10
Solve for the ratio:
C = 7. 5/7.5 = 1.00
H = 10/7.5 = 1.333
Multiply by 3 to get whole numbers: i.e.,
C = 1.00 x 3 = 3.00
H - 1.333 x 3 = 3.999 = 4.00 rounded for empirical formula of
C3H4 which is CnH2n-2
C2H2
C3H4
C4H6
C5H8
CnH2n-2 is the alkyne homologous series