4. When $a>1$, if the inequality
$$
\begin{array}{l}
\frac{1}{n+1}+\frac{1}{n+2}+\cdots+\frac{1}{2 n} \\
>\frac{7}{12}\left(\log _{a+1} x-\log _{a} x+1\right)
\end{array}
$$

holds for all positive integers $n$ not less than 2, then the range of $x$ is ( ).
(A) $21$
4. (D).

Let $f^{\prime}(n)=\frac{1}{n+1}+\frac{1}{n+2}+\cdots+\frac{1}{n+n}$. Then
$$
\begin{aligned}
f(n+1) & =f(n)+\frac{1}{2 n+1}+\frac{1}{2 n+2}-\frac{1}{n+1} \\
& =f(n)+\frac{1}{2 n+1}-\frac{1}{2 n+2} \\
& >f(n) .
\end{aligned}
$$

Therefore, $f(n)$ is an increasing function, so $f(n) \geqslant f(2)$.
Given that the inequality always holds, we have
$$
\frac{7}{12}\left(\log _{a+1} x-\log _{a} x+1\right)1$, then $x>1$.
