Divide and Conquer: Exponentiation
320 = (3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3) ⋅ (3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3) = (3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3 ⋅ 3)2
If we perform the first 9 multiplications to obtain 310, and perform the last 9 multiplications to obtain 310, and then multiply those two numbers, there are still 19 multiplications in all.
But if we notice we are calculating 310 twice, we can eliminate 9 multiplications by calculating 310 only once and squaring that result. That way, we get the desired result using only 10 multiplications.
We can do even better by applying that same idea, recursively, to the calculation of 310.