手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

Mathematica和Maple在处理数论问题的效果对比

时间:2024-10-12 09:22:53

Mathematica和Maple都很强大。正好我的电脑上安装了这两款软件,可以一边学习,一边加以对比。

Mathematica和Maple在处理数论问题的效果对比

工具/原料

电脑

Mathematica

Maple

素数的判定

1、Maple判断一个数字是否素数,用isprime:isprime(2^(2^7)+1)

Mathematica和Maple在处理数论问题的效果对比

2、Mathematica用的是PrimeQ:PrimeQ[2^2^7 + 1]

Mathematica和Maple在处理数论问题的效果对比

3、但是,两个软件不能判断过大的数值:isprime(2^(2^(2^7))+1)PrimeQ[2^2^2^7 + 1]看来,3M软件的局限性很大。

Mathematica和Maple在处理数论问题的效果对比
Mathematica和Maple在处理数论问题的效果对比

第n个素数

1、Maple给定第n个素数,用:ithprime(10^6)第1000000个素数是15485863。

Mathematica和Maple在处理数论问题的效果对比

2、Mathematica用Prime[10^6]给出第1000000个素数。

Mathematica和Maple在处理数论问题的效果对比

3、Maple算不出第10^10个素数,Mathematica却可以,答案是252097800623。

Mathematica和Maple在处理数论问题的效果对比
Mathematica和Maple在处理数论问题的效果对比

下一个素数

1、求出比10^10大的最小素数,Maple的方法:nextprime(10^10);答案是10000000019。

Mathematica和Maple在处理数论问题的效果对比

2、Mathematica的方法:NextPrime[10^10]就是换了个大写字母。

Mathematica和Maple在处理数论问题的效果对比

3、求出比10^10小的最大素数,Mathematica只需要稍微调整:NextPrime[10^10, -1]而Maple却需要换命令:prevprime(10^10)

Mathematica和Maple在处理数论问题的效果对比
© 手抄报圈