To find the time taken for contact with the spring:
m a = - k e
4 x 10^6 x" = -100,000 x
x " = - x / 40
x = A * sin( wt) + A * cos(wt) , w = sqrt(1/40)
x(0) = 0, so x = A sin(wt)
The time in contact with the spring is half an oscillation, so wt = pi (velocity here doesn't actually matter...