Underlying Idea
Using the following observation, one can create a recursive algorithm that computes xn for an integer n using squaring and multiplication:

A brief analysis shows that such an algorithm uses log2n squarings and at most log2n multiplications. For n > about 4 this is computationally more efficient than naïvely multiplying the base with itself repeatedly.
Read more about this topic: Exponentiation By Squaring
Famous quotes containing the words underlying and/or idea:
“Comedy deflates the sense precisely so that the underlying lubricity and malice may bubble to the surface.”
—Paul Goodman (19111972)
“Let the erring sisters depart in peace; the idea of getting up a civil war to compel the weaker States to remain in the Union appears to us horrible to the last degree.”
—Jane Grey Swisshelm (18151884)