Consider a sequence of n operations on a data structure in which the cost ci of the ith operation is defined as ci = i2 if i is a power of 2 and ci = 1 otherwise.
Use the accounting method to get an upper bound on the amortized cost of a single operation.