7. Given that $m$ is a positive integer, the positive integer $n$ satisfies the condition: if $P(x)=(m x+1)^{n}=a_{n} x^{n}+$ $a_{n-1} x^{n-1}+\cdots+a_{1} x+a_{0}$, then there exists some $i \in\{1,2, \cdots, n\}$, such that $a_{i}=a_{i-1}$ holds, the sum of the smallest $m$ such $n$ is $\qquad$.
7. $\frac{m\left(m^{2}+2 m-1\right)}{2}$ Detailed explanation: $a_{i}=C_{n}^{i} m^{i} ， a_{i-1}=C_{n}^{i-1} m^{i-1}$.
$$
\begin{array}{l}
1=\frac{a_{i}}{a_{i-1}}=\frac{C_{n}^{i} m^{i}}{C_{n}^{i-1} m^{i-1}}=\frac{n!}{i!(n-i)!} \cdot \frac{(i-1)!(n-i+1)!}{n!} \cdot m=\frac{m(n-i+1)}{i} \\
i=\frac{m(n+1)}{m+1}, \because i \in \mathbf{N}^{*}, \quad(m, m+1)=1, \therefore m+1 \mid n+1 .
\end{array}
$$

The smallest $n$ for each $m$ that satisfies the condition is $k(m+1)-1, \quad k=1,2, \cdots, m$,
their sum is $\sum_{k=1}^{m}(k(m+1)-1)=\frac{m(m+1)}{2}(m+1)-m=\frac{m\left(m^{2}+2 m-1\right)}{2}$.