Example 5 Given an arithmetic sequence $\left\{a_{n}\right\}$. Try to find the sum of the first $n$ terms of the sequence: $a_{1}, a_{1}+a_{2}, a_{1}+a_{2}+a_{3}, \cdots, a_{1}+a_{2}+\cdots$ $+a_{n}$.
Solve: When the equilateral triangular number table as shown in the figure is rotated $60^{\circ}$ clockwise and counterclockwise around the center, and the three number tables are superimposed, the sum of the three numbers in each position is $n+2$.
1
12
$\begin{array}{lll}1 & 2 & 3\end{array}$
```
... ... ...
```
$\begin{array}{lllll}1 & 2 & 3 & \cdots & n\end{array}$
```
a
a1
a1
... ... ...
a
```
Construct the equilateral triangular number table as shown in the left figure using the terms of $S_{n}$. Suppose the three terms $a_{i}, a_{j}, a_{k}$ form an equilateral triangle, and the center coincides with the center of the original equilateral triangular number table (as shown in the right figure), then $i+j+k=n+2$.
$$
\begin{aligned}
\because & a_{i}+a_{j}+a_{k} \\
= & {\left[a_{1}+(i-1) d\right]+\left[a_{1}+(j-1) d\right]+} \\
& {\left[a_{1}+(k-1) d\right] } \\
= & 3 a_{1}+(n-1) d=2 a_{1}+a_{n},
\end{aligned}
$$
$\therefore$ When the equilateral triangular number table of $S_{n}$ is rotated $60^{\circ}$ clockwise and counterclockwise, and superimposed, the sum of the two terms in each position is $2 a_{1}+a_{n}$.
Therefore, we have
$$
\begin{aligned}
3 S_{n} & =\left(2 a_{1}+a_{n}\right)(1+2+\cdots+n) \\
& =\left(2 a_{1}+a_{n}\right) \cdot \frac{n(n+1)}{2} .
\end{aligned}
$$

Thus, the required sum is
$$
S_{n}=\frac{1}{6} n(n+1)\left(2 a_{1}+a_{n}\right) \text {. }
$$

Note: (1) If the terms are recombined, the sum of the series can be expressed as
$$
\begin{array}{l}
n a_{1}+(n-1) a_{2}+\cdots+2 a_{n-1}+a_{n} \\
=\frac{1}{6} n(n+1)\left(2 a_{1}+a_{n}\right) .
\end{array}
$$

Clearly, if $a_{1}=1, a_{n}=2 n-1$, we obtain the conclusion of Example 4.
(2) If $a_{i}$ and $a_{n} \ldots 1(i=1,2, \cdots, n)$ are swapped, then
$$
\begin{aligned}
& a_{1}+2 a_{2}+3 a_{3}+\cdots+n a_{n} \\
= & \frac{1}{6} n(n+1)\left(2 a_{n}+a_{1}\right) .
\end{aligned}
$$

At this point, if $\left\{a_{n}\right\}$ is the sequence of natural numbers, then
$$
1^{2}+2^{2}+\cdots+n^{2}=\frac{1}{6} n(n+1)(2 n+1)
$$