ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 07 Nov 2014 15:36:58 +0100how to solve this equationhttps://ask.sagemath.org/question/24807/how-to-solve-this-equation/(83359654581036155008716649031639683153293510843035531 ^x) % 32003240081 =1Fri, 07 Nov 2014 14:33:42 +0100https://ask.sagemath.org/question/24807/how-to-solve-this-equation/Answer by kcrisman for <p>(83359654581036155008716649031639683153293510843035531 ^x) % 32003240081 =1</p>
https://ask.sagemath.org/question/24807/how-to-solve-this-equation/?answer=24809#post-id-24809Here'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.)
Fri, 07 Nov 2014 15:36:58 +0100https://ask.sagemath.org/question/24807/how-to-solve-this-equation/?answer=24809#post-id-24809