I am currently reading Skiena\'s \"The Algorithm Design Manual\".
He describes an algorithm for calculating the power of a number i.e. calculate a^n.
a^n
x = power(a, n/2)
will give you a^n/2. If even this whole statement is squared giving (a^n/2)^2. Now if n is odd, during n/2 a power of a^1 is lost so to get it back it is multiplied with a. This is according to the equation given.