Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to prove:

$$\sum_{k=1}^n\sigma(k) = n^2 - \sum_{k=1}^nn\mod k$$

where $\sigma(k)$ is sum of divisors of k.

share|cite|improve this question
up vote 3 down vote accepted

Using the identity \begin{align} n \ \text{mod} \ k = n - k \lfloor \tfrac{n}{k} \rfloor, \end{align} one has \begin{align} \sum_{k = 1}^{n} (n \ \text{mod} \ k) =\sum_{k = 1}^{n} n - k \lfloor \tfrac{n}{k} \rfloor = n^{2} - \sum_{k = 1}^{n} k \lfloor \tfrac{n}{k} \rfloor. \end{align} Finally, since \begin{align} \sum_{k = 1}^{n} k \lfloor \tfrac{n}{k} \rfloor = \sum_{k = 1}^{n} \sigma(k), \end{align} the claim follows.

share|cite|improve this answer

$$\sum_{k=1}^n \sigma(k) = \sum_{k=1}^n\sum_{d|k} d = \sum_{d=1}^n\sum_{k=1}_{d|k}^{n}d = \sum_{d=1}^n d\left\lfloor \frac n d\right\rfloor$$

Now just prove that $$d\left\lfloor \frac n d\right\rfloor = n-(n\mod d)$$

share|cite|improve this answer
You beat me to the punch by 1 min! – user02138 Jun 13 '13 at 15:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.