I was working on this problem in the modular arithmetic section. When I looked at the implementation of the sum of the divisors I was confused.
Here is the line of code I was confused by.
div_sum = div_sum * (expo(p[i], k[i] + 1) - 1) % MOD * expo(p[i] - 1, MOD - 2) % MOD;
Why do we have to exponentiate the denominator by mod-2 and then multiply it to the numerator?