Example 2 There is a pile of goods stacked in a regular manner, with each layer arranged in a rectangle. The bottom layer has 30 items on one side and 15 items on the other, and each subsequent layer has one less item on each side, until the top layer is a straight line. If this pile of goods is restacked into a square pyramid (not necessarily reaching the apex), how many items should be placed on each side of the bottom layer at least?
(1997, Fujian Province Mathematics Competition)
Solution: The total number of items in this pile of goods is
$$
\begin{array}{l} 
30 \times 15 + 29 \times 14 + 28 \times 13 + \cdots + 16 \times 1 \\
= (15 + 15) \times 15 + (15 + 14) \times 14 + \cdots \\
+ (15 + 1) \times 1 \\
= 15 \times (15 + 14 + \cdots + 1) + 15^2 + 14^2 \\
+ \cdots + 1^2 \\
= 3040 .
\end{array}
$$

Suppose after changing the stacking method, at least $x$ items are stacked on each side of the bottom layer, then we have
$$
\left\{\begin{array}{l}
x^2 + (x-1)^2 + \cdots + 1^2 \geqslant 3040, \\
(x-1)^2 + (x-2)^2 + \cdots + 1^2 \leqslant 3040 .
\end{array}\right.
$$

That is, to solve the system of inequalities:
$$
\left\{\begin{array}{l}
x(x+1)(2x+1) \geqslant 18240, \\
(x-1)x(2x-1) \leqslant 18240 .
\end{array}\right.
$$

The left side of the above two inequalities is approximately $2x^3$. From $2x^3 \approx 18240$, we have $x \approx 21$. Substituting $x=21$, both inequalities are satisfied.

When $x=20$, the left side of (1) is 17220, so it does not satisfy;

When $x=22$, the left side of (2) is 19866, which also does not satisfy.

In summary, $x=21$ is the solution, meaning at least 21 items should be placed on each side of the bottom layer.