Math Fundamentals18 sections · 814 units
Open in Course

Super Pow - Breaking Down the Exponent

Decomposition trick

Say b=[1,2,3]b = [1, 2, 3], which means b=123b = 123. You can write this as 123=12×10+3123 = 12 \times 10 + 3.

So a123=a12×10+3=(a12)10×a3a^{123} = a^{12 \times 10 + 3} = (a^{12})^{10} \times a^3. This breaks the problem into two smaller exponents: a12a^{12} raised to the 10th power, and a3a^3.

You can recurse on the left part ([1,2][1, 2]) and handle the last digit (33) separately. Each step reduces the size of bb by one digit.