Mathematica基础——再谈素数

 时间:2024-10-20 00:28:50

本文进一步学习素数。

Mathematica基础——再谈素数

工具/原料

电脑

Mathematica

方法/步骤

1、RandomPrime[100],随机给出一个小于100的素数。

Mathematica基础——再谈素数

2、给出比999大的最小素数:NextPrime[999觥终柯计]给出比999小的最大素数:NextPrime[999,-1]

Mathematica基础——再谈素数

Mathematica基础——再谈素数

3、MersennePrimeExponent[6]给出第六个梅森素数的指数。

Mathematica基础——再谈素数

4、MersennePrimeExponentQ[17],判断17是不是梅森素数的指数。

Mathematica基础——再谈素数

5、PerfectNumber[6]给出第6个完美数。

Mathematica基础——再谈素数

6、判断一个数字是不是完美数:PerfectNumberQ[6]PerfectNumberQ[36]

Mathematica基础——再谈素数

【Mathematica】把偶数写成两个素数的和 如何使用mathematica对列表元素进行排序? MATLAB图像的逻辑运算 Mathematica怎么批量处理列表中的元素? Matlab三维图形绘制
热门搜索
鸭子的图片 吉祥物图片 羊图片大全 舒淇图片 陈数图片