计算大数的模

发布于 2024-09-29 04:25:35 字数 199 浏览 0 评论 0原文

请问

如何计算2^301 mod 77?我确实查看了链接StackOverflow。但不明白625 mod 221 = 183 mod 221的步骤。转换是如何发生的?

All,

How can I calculate 2^301 mod 77? I did check out the link StackOverflow. But did not understand the step wherein 625 mod 221 = 183 mod 221. How did the conversion take place?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

彡翼 2024-10-06 04:25:35

请查看此处的问题以获得答案对于你的问题。

基本上,(X * Y) % Z == ((X % Z) *​​ (Y % Z)) % Z

因此,作为起点,2^301 % 77 == ((2^150 % 77) * (2^151 % 77)) % 77。继续分裂,直到获得合理的数字,然后重新组合。您将能够在整个过程中将您的数字保持在合理的大小。

Take a look at the question here for an answer to your question.

Basically, (X * Y) % Z == ((X % Z) * (Y % Z)) % Z.

So, as a starting point, 2^301 % 77 == ((2^150 % 77) * (2^151 % 77)) % 77. Keep splitting until you have reasonable numbers, then recombine. You will be able to keep your numbers at a reasonable size the whole way through.

迷爱 2024-10-06 04:25:35

我不明白你帖子的第二部分,可能是因为你没有包含你实际点击的链接。但是您的问题可以通过阅读页面并实现正确的模幂算法来解决

I don't understand the second part of your post, probably because you didn't include the link you actually followed. But your problem can be solved reading this page and implementing a proper algorithm of modular exponentiation

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文