Step 1: Understanding binomial coefficients
The general term in the binomial expansion of \( (1 + x)^n \) is given by:
\[
T_k = \binom{n}{k} x^k.
\]
The coefficients of the \( r^{th} \), \( (r+1)^{th} \), and \( (r+2)^{th} \) terms are given by:
\[
\binom{n}{r}, \quad \binom{n}{r+1}, \quad \binom{n}{r+2}.
\]
We are given the ratio:
\[
\binom{n}{r} : \binom{n}{r+1} : \binom{n}{r+2} = 4:15:42.
\]
Step 2: Expressing binomial coefficients as ratios
Using the property of binomial coefficients:
\[
\frac{\binom{n}{r+1}}{\binom{n}{r}} = \frac{n-r}{r+1},
\]
\[
\frac{\binom{n}{r+2}}{\binom{n}{r+1}} = \frac{n-r-1}{r+2}.
\]
Thus, we obtain the equations:
\[
\frac{\binom{n}{r+1}}{\binom{n}{r}} = \frac{15}{4} = \frac{n-r}{r+1},
\]
\[
\frac{\binom{n}{r+2}}{\binom{n}{r+1}} = \frac{42}{15} = \frac{n-r-1}{r+2}.
\]
Step 3: Solving for \( n - r \)
From the first equation:
\[
(n - r) = \frac{15}{4} (r + 1).
\]
From the second equation:
\[
(n - r - 1) = \frac{42}{15} (r + 2).
\]
Solving these equations simultaneously gives:
\[
n - r = 14.
\]
Step 4: Conclusion
Thus, the final answer is:
\[
\boxed{14}.
\]