I took this question previously. My colleagues got [math]4 \ kg[/math], but I got [math]3 \ kg[/math].
Here How I did it.
let [math]g = 10 \ m/s^2[/math]
initial total energy = final total energy
[math]mgh = mgx +\frac{1}{2}kx^2[/math]
[math]mgh - mgx = \frac{1}{2}kx^2[/math]
[math]m = \frac{0.5kx^2}{g(h - x)} = \frac{0.5(3000)(-0.1)^2}{10[0.4 - (-0.1)]} = 3 \ kg[/math]
Did I do anything wrong in my calculations?