divisorsum
Divisor sum, also called the sum of divisors function, denoted σ(n), assigns to a positive integer n the sum of all positive divisors of n, including 1 and n itself. In symbols, σ(n) = ∑_{d|n} d. The function is defined for n ≥ 1.
If n has prime factorization n = ∏ p_i^{a_i}, then σ(n) = ∏ (p_i^{a_i+1}-1)/(p_i-1). This formula shows that σ is multiplicative:
Proper divisor sum s(n) = σ(n) - n excludes n itself. Numbers for which σ(n) = 2n are perfect
Besides its basic definition, σ(n) is used in various contexts: it appears in average order estimates (on
Computationally, σ(n) can be computed efficiently from the prime factorization of n, and sieve methods allow