Mathematica Overflow[] error : Why and how-to bypass?

后端 未结 3 1829
清歌不尽
清歌不尽 2021-01-05 02:33

I never had an overflow error in Mathematica, the following happened.

I demo-ed the principle of RSA-encryption as follows:

 n = 11*13
 m = EulerPhi[         


        
3条回答
  •  南方客
    南方客 (楼主)
    2021-01-05 03:02

    Yep, as the other guy answered you have well and truly reached the $MaxNumber Mathematica can handle.

    There is a bypass which will find mod for many large numbers larger than $MaxNumber.

    Rather than imputing large numbers directly into Mathematica, such as 163840000000^18158086021982021938023 which is absolutely huge, use Modular arithmetic to save Mathematica the trouble of having to compute such a large number.

    You should be able to develop a Mathematica Code for this, I do not yet know how to do this. But you can do it by hand, by finding: Mod[Mod[Mod[Mod[Mod[Mod[Mod[Mod[163840000000^181,n]^580,n]^860,n]^219,n]^820,n]^219,n]^380,n]^23,n]

    Which gives the correct answer you are looking for, without exceeding $MaxNumber

提交回复
热议问题