Let W be the weight (in pounds) attached to the spring, and let S be the length of the spring (in cm) after it stretches.
From the problem, we know that the spring will stretch one-sixth of the weight attached to it. So:
S = (1/6)W + 40
This equation represents the situation where the length of the spring (S) is a function of the weight attached to it (W).