Step 1: Count balls layer by layer.
Layer k has $1 + 2 + \dots + k = \frac{k(k+1)}{2}$ balls. This gives 1, 3, 6, 10 for the first four layers, as in the question.
Step 2: Split the sum.
For n layers the total is
\[ S_n = \frac{1}{2}\sum_{k=1}^{n} k^2 + \frac{1}{2}\sum_{k=1}^{n} k = \frac{1}{2}\left[\frac{n(n+1)(2n+1)}{6} + \frac{n(n+1)}{2}\right] \]
Taking $\frac{n(n+1)}{2}$ common inside the bracket, this simplifies to $S_n = \frac{n(n+1)(n+2)}{6}$.
Step 3: Notice that S_n only grows.
Each new layer adds balls, so $S_n$ increases with n. That means only one value of n can give exactly 8436 balls, and we can test the options in order.
Step 4: Test the options.
$n = 32: \; S = \frac{32 \times 33 \times 34}{6} = 5984$.
$n = 34: \; S = \frac{34 \times 35 \times 36}{6} = 7140$.
$n = 38: \; S = \frac{38 \times 39 \times 40}{6} = 9880$.
The target 8436 lies between 7140 and 9880, so the answer must be between 34 and 38. Only option 3 (36) is there.
Step 5: Confirm with n = 36.
\[ \sum k^2 = \frac{36 \times 37 \times 73}{6} = 16206, \qquad \sum k = \frac{36 \times 37}{2} = 666 \]
\[ S_{36} = \frac{16206 + 666}{2} = \frac{16872}{2} = 8436 \]
This matches the given number of balls.
Final Answer:
Exactly 36 layers use up the 8436 balls, so option 3 is correct.
\[ \boxed{3} \]