7. (50 points) Let $r(n)$ denote the sum of the remainders when $n$ is divided by $1, 2, \cdots, n$. Find all positive integers $m (1 < m \leqslant 2014)$ such that
$$
r(m) = r(m-1).
$$
7. Let the remainder of $n$ divided by $k(1 \leqslant k \leqslant n)$ be $r_{k}(n)$.

Thus, $r_{k}(n)=n-k\left[\frac{n}{k}\right]$, where $[x]$ denotes the greatest integer not exceeding the real number $x$.
$$
\begin{array}{l}
\text { Then } r(m)=\sum_{k=1}^{m} r_{k}(m) \\
=\sum_{k=1}^{m}\left(m-k\left[\frac{m}{k}\right]\right)=m^{2}-\sum_{k=1}^{m} k\left[\frac{m}{k}\right] \text {. } \\
\text { Hence } r(m)=r(m-1) \\
\Leftrightarrow \sum_{k=1}^{m} k\left[\frac{m}{k}\right]-\sum_{k=1}^{m-1} k\left[\frac{m-1}{k}\right]=2 m-1 \\
\Leftrightarrow m+\sum_{k=1}^{m-1} k\left(\left[\frac{m}{k}\right]-\left[\frac{m-1}{k}\right]\right)=2 m-1 \\
\Leftrightarrow m+\sum_{\substack{k \mid m \\
1 \leqslant k \leqslant m-1}} k=2 m-1 \\
\Leftrightarrow \sum_{\substack{k \mid m \\
1 \leqslant k \leqslant m}} k=2 m-1 \text {. } \\
\end{array}
$$

The left side of equation (1) is the sum of all positive divisors of $m$, denoted as $\sigma(m)$.
Let $m=\prod_{i=1}^{1} p_{i}^{\alpha}$ (prime $\left.p_{1}1$, by $1<m \leqslant 2014$, we get
$m \in\left\{p^{2 \alpha}, 2^{\alpha} p^{2 \beta} \mid p\right.$ is an odd prime $\} \cup B$,

where, $B=\left\{3^{2} \times 5^{2}, 3^{2} \times 7^{2}, 3^{2} \times 11^{2}, 3^{2} \times 13^{2}\right.$,
$$
\begin{array}{l}
5^{2} \times 7^{2}, 2 \times 3^{2} \times 5^{2}, 2^{2} \times 3^{2} \times 5^{2}, \\
\left.2 \times 3^{2} \times 7^{2}, 2^{2} \times 3^{2} \times 7^{2}\right\}
\end{array}
$$

If $m=p^{2 \alpha}$, then
$$
\begin{array}{l}
\text { Equation (2) } \Leftrightarrow \frac{p^{2 \alpha+1}-1}{p-1}=2 p^{2 \alpha}-1 \\
\Leftrightarrow p^{2 \alpha+1}-2 p^{2 \alpha}-p+2=0 \\
\Leftrightarrow(p-2)\left(p^{2 \alpha}-1\right)=0 \\
\Leftrightarrow p=2 \text { or } 1,
\end{array}
$$

which is a contradiction.
If $m=2^{\alpha} p^{2 \beta}$, then
$$
\begin{array}{l}
\text { Equation (2) } \Leftrightarrow\left(2^{\alpha+1}-1\right) \frac{p^{2 \beta+1}-1}{p-1}=2^{\alpha+1} p^{2 \beta}-1 \\
\Leftrightarrow p^{2 \beta+1}-2^{\alpha+1} p^{2 \beta}+2^{\alpha+1}-p=0 \\
\Leftrightarrow\left(p-2^{\alpha+1}\right)\left(p^{2 \beta}-1\right)=0 \\
\Leftrightarrow p=2^{\alpha+1} \text { or } 1,
\end{array}
$$

which is a contradiction.
If $m \in B$, upon inspection, none satisfy equation (2).
In summary, the required $m=2^{s}(s \in \mathbf{Z}, s \leqslant 10)$.