In number theory the sum-of-divisors function of a positive integer, denoted σ(n), is the sum of all the positive divisors of the number n.
It is a multiplicative function, that is m and n are coprime then .
The value of σ on a general integer n with prime factorisation
is then
The average order of σ(n) is .
A perfect number is defined as one equal to the sum of its "aliquot divisors", that is all divisors except the number itself. Hence a number n is perfect if σ(n) = 2n. A number is similarly defined to be abundant if σ(n) > 2n and deficient if σ(n) < 2n. A pair of numbers m, n are amicable if σ(m) = m+n = σ(n): the smallest such pair is 220 and 284.