How Can I find the summation of divisors of $n^p$.

61 Views Asked by At

For Example $n=8$ and $p=2$. So $n^p=64$. And the summation of divisors is $1+2+4+8+16+32+64=127$. But the problem arises when $n=10^6$ and $p=10^6$. Remember u can modulus the result by $100$.

1

There are 1 best solutions below

2
On

If $n=p_1^{k_1}\cdots p_m^{k_m}$, where $p_1,\ldots,p_m$ are distinct primes, then the sum of its divisors is $$ s=\frac{p_1^{k_1+1}-1}{p_1-1}\cdots\frac{p_m^{k_m+1}-1}{p_m-1}. $$