This is a very interesting problem with a lots of history. Anyways we will not wonder into it. We shall see how fast can we calculate xn, given x and n where n is a positive integer. The brute force method would be to run a loop from 2 to n and calculate in n-1 steps. We will discuss three methods to do it quickly. Binary Method This the most common method used in programs today. It is also called