First, forget about “1 for all other operations” and “exact power 3” bits for a minute. What if the cost was 2i when i am the exact power of 2?
Well, suppose we pretend that each operation costs four. That is, for each operation, we put four coins in our “IOU heap” ... Then we use these coins to “pay” when we press the actual authority 2. (This is one way to describe the potential function method).
Step 1: Deposit four coins. You need to pay 2 * 1 = 2, so our pile of coins is doubled.
Step 2: Deposit four more coins. You need to pay 2 * 2 = 4, so our bunch again for two.
Step 3: Deposit four coins. There are six coins in the heap now.
Step 4: Deposit four coins. The heap now has ten coins, but 4 is the power of 2, so you need to pay 4 * 2 = 8, so that our pile will again drop to two coins.
Steps 5-7: Deposit four coins each. There are 14 coins in total.
Step 8: Deposit four coins (total = 18), spend 8 * 2 = 16, again there are two coins left.
It is fairly easy to prove that a steady state is that we continue to deplete our coins to a constant (2), but we never sink below. Therefore, the amortized cost is four units per transaction.
Now suppose that operation X costs 2i when i equals 2 (and zero otherwise). Suppose operation Y costs 3i when i am cardinality 3 (and zero otherwise). And suppose operation Z is worth 1, unless I am power 2 or power 3. Note that your problem is equivalent to performing operations X and Y and Z for each iteration ... Therefore, if you can determine the amortized cost X, Y and Z separately, you can simply sum them up to get the total amortized cost.
I just gave you X; I leave Y and Z as an exercise. (Although I do not believe the final answer will be 10. Close to 10, maybe ...)