Make pow_mod overflow safe by adding mul_mod function.
Make pow_mod overflow safe by adding mul_mod function.

mul_mod returns (a * b) % mod, handling the potential overflow
that could occur. If overflow happens, the manual handling is
necessarily _very_ slow.

bsamseth/project-euler,bsamseth/project-euler