Sum-of-divisors function

In number theory the sum-of-divisors function of a positive integer, denoted σ(n), is the sum of the positive divisors of the number n.

It is a multiplicative function, that is is m and n are coprime then $$\sigma(mn) = \sigma(m)\sigma(n)$$.

The value of σ on a general integer n with prime factorisation


 * $$n = \prod_i p_i^{a_i} \,$$

is then


 * $$\sigma(n) = \prod_i \left(1+p+p^2+\cdots+p_i^{a_i}\right) .\,$$

The average order of σ(n) is $$ \frac{\pi^2}{6} n$$.