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

The sum of the odd divisors of n is $-\sum_{d|n}(-1)^{n/d}d$, and if n is even, then $$\sum_{d|n}(-1)^{n/d}d=2\sigma(n/2)-\sigma(n)$$

Could you give me some hints on that?

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

Hint : $d$ is an even divisors of $n$ if and only if $\frac{d}{2}$ is a divisors of $\frac{n}{2}$.

EDIT : Here's a complete proof. We shall prove two things : the sum of odd divisors of $n$ is given by the formula $-\sum_{d |n} (-1)^{n/d} d$, and if $n$ is even, then it's also equal to $\sigma(n)-2\sigma(n/2)$.

If $n$ is odd, this is obvious, so we're reduced to the case where $n$ is even. From the hint above, we get that the sum of even divisors of $n$ is $2\sigma(n/2)$. So the sum of odd divisors is $\sigma(n)-2\sigma(n/2)$. Finally, consider the sum

$$\sigma(n) + \sum_{d |n} (-1)^{d} \frac{n}{d} = \sum_{d |n} (1+(-1)^{d}) \frac{n}{d} = 2 \sum_{d |n, \ d \text{ even}} \frac{n}{d}$$

Changing the variable to $d' = d/2$, you get

$$\sigma(n) + \sum_{d |n} (-1)^{d} \frac{n}{d} = 2 \sum_{d' |n/2}\frac{n/2}{d'} = 2 \sigma(n/2)$$

Which concludes the proof. One a side note, you could perform the calculation using Dirichlet series, thus finding :

$$\eta(s) \zeta(s-1) = (1-2^{1-s}) \zeta(s) \zeta(s-1)$$

where $\eta(s) = \sum_{n \ge 1} \frac{(-1)^{n+1}}{n^s}$.

share|cite|improve this answer
It ought to be $\sum_{d|n}(-1)^{n/d}d$, rather than$\sum_{d |n} (-1)^{d} \frac{n}{d}$. – Vladimir Nov 6 '11 at 13:43
@Z_Fang : both sums are equal (just change the variable from $d$ to $\frac{n}{d}$, which also runs through the divisors of $n$). Also note that I use this principle a second time to get $\sum_{d' | n/2} \frac{n/2}{d'} = \sigma(n/2)$. – Joel Cohen Nov 6 '11 at 17:43
I was still wondering why it is obvious when n is odd. – Vladimir Nov 6 '11 at 21:41
When $n$ is odd, every divisor is odd so the sign disappears and you end up with the plain sum of divisors (which is the sum of odd divisors). – Joel Cohen Nov 6 '11 at 22:57

For the first part, you could try writing $n=2^km$, where $m$ is odd. Then the divisors of $n$ are the numbers $d,2d,4d,\dots,2^kd$ where $d$ runs through the odd divisors of $n$, which is to say, through the divisors of $m$. Now you can rewrite your sum to involve a sum on powers of 2.

share|cite|improve this answer
Err... How should I rewrite it? – Vladimir Nov 6 '11 at 14:07
Well, your sum of $f(d)$ on all divisors $d$ of $n$ becomes a double sum of $f(2^rd)$ on all odd divisors $d$ of $n$ and on $r$ from 0 to $k$. – Gerry Myerson Nov 6 '11 at 23:46

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.