Determine y from degrees of freedom

Suppose a polyatomic gas molecule has n degree of freedom.
Total energy associated with one gram molecule of the gas, i.e.,