where is the error?
x = 15
z = power_mod(x,3,23) #z=15^3 mod 23
inverse = inverse_mod(3,23) #1/3 mod 23
assert mod(3*inverse,23)==1 #ok
y = power_mod(z,inverse,23) # y = 15^(3/3) = 15
print(y)
18
Thanks a lot to everyone
1 | initial version |
where is the error?
x = 15
z = power_mod(x,3,23) #z=15^3 mod 23
inverse = inverse_mod(3,23) #1/3 mod 23
assert mod(3*inverse,23)==1 #ok
y = power_mod(z,inverse,23) # y = 15^(3/3) = 15
print(y)
18
Thanks a lot to everyone