Step 1: Understand the forces at equilibrium.
At equilibrium, the spring force balances the gravitational force:
\[
k \Delta x = Mg
\]
where \( k \) is the spring constant and \( \Delta x \) is the spring compression (or extension).
Step 2: Relate the spring constant to angular frequency.
For SHM, the angular frequency is related to the spring constant by:
\[
\omega = \sqrt{\frac{k}{M}} \quad \Rightarrow \quad k = M \omega^2
\]
Step 3: Solve for the compression \( \Delta x \).
Substitute \( k = M \omega^2 \) into the equilibrium equation:
\[
M \omega^2 \Delta x = Mg
\]
Solving for \( \Delta x \):
\[
\Delta x = \frac{g}{\omega^2}
\]