Points: Show how the modular exponentiation algorithm computes 3327 mod 50. Show your work by recording the values and power at the beginning and end of each iteration in the table.
Procedure: mod_exponent(Z, n) = (a^k-1 * a^k-2 * ... * a^1) mod n, where a, k, and m are integers.
Initialize power = a mod n.
For i = 0 to k-1:
if a_i = 1 then
power = (power * power) mod n
endif
endfor
Return power.
Given: a = 33, k = 27, and n = 50.
Beginning of Iteration End of Iteration Power
--------------------------------------------------
0 0 39