4. Every positive integer greater than 2 can be expressed as the sum of several distinct natural numbers. For any positive integer $n(n \geqslant 3)$, find the maximum number of these addends $A(n)$.

Every positive integer greater than 2 can be expressed as the sum of several distinct natural numbers. For any positive integer $n(n \geqslant 3)$, find the maximum number of these addends $A(n)$.
(For any positive integer $n(n \geqslant 3)$, there must exist a positive integer $m$ such that
$$
1+2+\cdots+m \leqslant n<1+2+\cdots+m+(m+1),
$$

i.e., $\frac{m(m+1)}{2} \leqslant n<\frac{(m+1)(m+2)}{2}$.
At this time, $n$ can be expressed as the sum of at most $m$ different positive integers $\left(n=1+2+\cdots+(m-1)+\left(n-\frac{m(m-1)}{2}\right)\right)$.
Therefore, $A(n)=m$.
Furthermore, $m$ is the largest integer satisfying the inequality $\frac{1}{2} m(m+1) \leqslant n$, i.e., $m^{2}+m-2 n \leqslant 0$. Thus,
$$
m \leqslant \frac{-1+\sqrt{8 n+1}}{2} \text {. }
$$

Then $A(n)$ equals the largest integer not exceeding $\frac{-1+\sqrt{8 n+1}}{2}$.)