Modular inversion via powering