# How are 10-20 digit multiperfect and hemiperfect numbers efficiently computed?

This numericana item on multiperfect and hemiperfect numbers contains some impressively enormous numbers. How were these actually computed ? The associated OEIS pages (A007691 & A159907) just give brute force code which (at least briefly playing with PARI) isn't going to scale up beyond $10^{10}$ or so on sane timescales. This suggests there's some ways of doing it more efficiently (any links or tips?)... or is this what supercomputers are for?

You can use the fact that the sum of divisors function is multiplicative. We have that $\sigma(p^n)=\frac {p^{n+1}-1}{p-1}$ for $p$ prime and $\sigma(rs)=\sigma(r)\sigma(s)$ for $r$ coprime to $s$. So you look for combinations of prime powers that cancel off the denominators. You need lots of prime factors, which therefore need to be pretty small, so you can ignore a lot of numbers.