Three things to remember:
Squaring reduces the problem size by half, giving you instead of
Odd exponents need one extra multiplication by the base
Negative exponents flip to reciprocals using the rule
This pattern appears in modular exponentiation, matrix exponentiation, and other divide-and-conquer algorithms. Halving the work repeatedly is a powerful trick.