sumofdivisors
Sum of divisors, denoted σ(n), is the arithmetic function that assigns to a positive integer n the sum of all positive divisors of n, including 1 and n. It can be written as σ(n) = ∑_{d|n} d. The function is multiplicative: if gcd(a,b) = 1, then σ(ab) = σ(a)σ(b). For a prime power p^k, σ(p^k) = (p^{k+1} − 1)/(p − 1). Consequently, for n with prime factorization n = ∏ p_i^{a_i}, σ(n) = ∏ (p_i^{a_i+1} − 1)/(p_i − 1).
Examples illustrate its use: σ(6) = 1 + 2 + 3 + 6 = 12, and σ(28) = 1 + 2 + 4 + 7
σ is the Dirichlet convolution of the identity function id(n) = n with the constant function 1, i.e.,
See also: Perfect number, Abundant number, Deficient number.