4. Given the sequence $\left\{x_{n}\right\}$ satisfies $x_{1}=1$, for $n \geqslant 1$, we have
$$
\begin{array}{l}
4\left(x_{1} x_{n}+2 x_{2} x_{n-1}+3 x_{3} x_{n-2}+\cdots+n x_{n} x_{1}\right) \\
=(n+1)\left(x_{1} x_{2}+x_{2} x_{3}+\cdots+x_{n} x_{n+1}\right) .
\end{array}
$$

Find the general term formula for $\left\{x_{n}\right\}$.
(53rd Romanian Mathematical Olympiad (Second Round))
For $n=1$, substituting into equation (1) yields $4 x_{1}^{2}=2 x_{1} x_{2}$, thus $x_{2}=2$.
For $n=2$, substituting into equation (1) yields
$4\left(x_{1} x_{2}+2 x_{2} x_{1}\right)=3\left(x_{1} x_{2}+x_{2} x_{3}\right)$, thus $x_{3}=3$.
Assume $x_{k}=k$, where $1 \leqslant k \leqslant n$. From
$$
4 \sum_{k=1}^{n} k x_{k} x_{n+1-k}=(n+1) \sum_{k=1}^{n} x_{k} x_{k+1} \text {, }
$$

we get $4 \sum_{k=1}^{n} k^{2}(n+1-k)$
$$
\begin{array}{l}
=(n+1) \sum_{k=1}^{n-1} k(k+1)+(n+1) n x_{n+1}, \\
4(n+1) \cdot \frac{n(n+1)(2 n+1)}{6}-4 \cdot \frac{n^{2}(n+1)^{2}}{4} \\
=(n+1) \cdot \frac{(n-1) n(2 n-1)}{6}+ \\
\quad(n+1) \cdot \frac{(n-1) n}{2}+n(n+1) x_{n+1} .
\end{array}
$$

Therefore, $x_{n+1}=\frac{2(n+1)(2 n+1)}{3}-n(n+1)-$
$$
\begin{aligned}
& \frac{(n-1)(2 n-1)}{6}-\frac{n-1}{2} \\
= & n+1 .
\end{aligned}
$$

In conclusion, $x_{n}=n$.