# Revision history [back]

Here's a simpler example, solving $53^x \equiv 1\text{ mod }(71)$.

sage: a = mod(53, 71)
sage: one = mod(1,71)
sage: one.log(a)
0

In retrospect, this is not so surprising (though presumably not the answer you wanted). Indeed, part of the point of this exercise is probably to show that it's hard to solve such things by brute force.

For small examples you can...

sage: for i in range(1,70):
if a^i==1:
print i
....:
<no output>

but I nearly crashed my computer trying to do yours that way, just as an experiment! So it's best to use some math. In this case, 53 was a primitive root of 71 - though your modulus is not prime. (Hint, hint.)