4. Every positive integer $n$ greater than 2 can be expressed as the sum of several distinct positive integers, and the maximum value of this number is $A(n)$. Express $A(n)$ in terms of $n$ as ( )
A. $\left[\frac{\sqrt{8 n+1}-1}{2}\right]$
B. $\left[\frac{\sqrt{8 n+1}+1}{2}\right]$
C. $\left[\frac{\sqrt{8 n+3}-1}{2}\right]$
D. $\left[\frac{\sqrt{8 n+3}+1}{2}\right]$
4. A Let $n=x_{1}+x_{2}+\cdots+x_{A(n)} ; x_{1}<x_{2}<\cdots<x_{A(n)}$ be positive integers, then $x_{1} \geqslant 1, x_{2} \geqslant 2$, $\cdots, x_{A(n)} \geqslant A(n)$, so $n \geqslant 1+2+\cdots+A(n)=\frac{1}{2} A(n)(A(n)+1)$, thus the positive integer $A(n) \leqslant$ $\left[\frac{\sqrt{8 n+1}-1}{2}\right]$

Also, $n=1+2+\cdots+\left(\left[\frac{\sqrt{8 n+1}-1}{2}\right]-1\right)+\left(\left[\frac{\sqrt{8 n+1}-1}{2}\right]+x\right)$, where $x$ is an integer and by $n \geqslant 1+2+\cdots+A(n)$ we know $x \geqslant 0$. Therefore, $A(n) \geqslant\left[\frac{\sqrt{8 n+1}-1}{2}\right]$. In conclusion, $A(n)=$ $\left[\frac{\sqrt{8 n+1}-1}{2}\right]$