aliquot sum Algorithm

It can be used to characterize the prime numbers, perfect numbers, deficient numbers, abundant numbers, and untouchable numbers, and to specify the aliquot sequence of a number. In number theory, the aliquot sum s(n) of a positive integer N is the sum of all proper divisors of N, that is, all divisors of N other than n itself.

aliquot sum source code, pseudocode and analysis