|
SOLUTIONS
|
MATHEMATICA 内置符号
RandomPrime
RandomPrime[{imin, imax}]
给出从
到
范围内的伪随机素数.
RandomPrime[imax]
给出从 2 到
范围内的伪随机素数.
RandomPrime[range, n]
给出由 n 个伪随机素数组成的列表.
更多信息更多信息
- 一个随机素数
的计算方式为在指定范围内重复生成伪随机整数,直到产生预期数目的素数. - 如果在指定范围内没有素数存在,则返回一个带有错误信息的未被计算的输入.
- RandomPrime[{imin, imax}] 在
和
之间等概率地选择素数. - RandomPrime[imax] 等价于 RandomPrime[{2, imax}].
- RandomPrime[range, {n1, n2, ...}] 给出一个由素数组成的
×
×... 数组.
版本 6 的新功能
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
