Ask Your Question
1

discrete_log?!

asked 2022-02-21 23:50:25 +0100

Dennis Yurichev gravatar image

So is it working at all?

In Mathematica:

In[88]:= MultiplicativeOrder[3, 401, 138]
Out[88]= 318

In SageMath 9.4:

discrete_log(138, 3, 401-1)
...
"ValueError: No discrete log of 138 found to base 3"

I tried 401 and operation="*"

What I want? I want 318, because, in Python:

pow(3,318,401)=138
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-02-22 23:05:55 +0100

rburing gravatar image

You asked for the discrete logarithm in the ring of integers $\mathbb{Z}$. You meant the following:

sage: discrete_log(Mod(138,401), Mod(3,401), 401-1)
318
edit flag offensive delete link more

Comments

Thanks for your reply!

Dennis Yurichev gravatar imageDennis Yurichev ( 2022-02-23 07:33:18 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-02-21 23:48:50 +0100

Seen: 1,873 times

Last updated: Feb 22 '22