Sums of Divisors, Perfect Numbers and Factoring

Let N be a positive integer, and let $\sigma (N)$ denote the sum of the divisors of N (e.g. $\sigma (6) = 1 + 2 + 3 + 6 = 12$). We show computing $\sigma (N)$ is equivalent to factoring N in the following sense: there is a random polynomial time algorithm that, given $\sigma (N)$, produces the prime factorization of N, and $\sigma (N)$ can be computed in polynomial time given the factorization of N.We show that the same result holds for $\sigma _k (N)$, the sum of the kth powers of divisors of NWe give three new examples of problems that are in Gill’s complexity class BPP: perfect numbers, multiply perfect numbers, and amicable pairs. These are the first “natural” sets in BPP that are not obviously in RP.