Answer: f=Mg for mass M
And f=mg for m
Equation for small oscillation of m is T=2Π√m/k
For M it will be
T=2Π√M/k
Explanation: the force acting on mass M will be f=Mg in a downward direction f=mg in a downward direction.
Net force acting downward will be f=g(M+m).