Existence of periodic solutions for a class of second order ordinary differential equations