You can express this idea recursively:
• Base case: x0=1
• If n is even: xn=(xn/2)2
• If n is odd: xn=x×xn−1
For negative n, compute x−n and take the reciprocal: 1/x−n.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Breaking down the exponent
You can express this idea recursively:
• Base case: x0=1
• If n is even: xn=(xn/2)2
• If n is odd: xn=x×xn−1
For negative n, compute x−n and take the reciprocal: 1/x−n.