跳到正文
RandNext
Esc

随机质数生成器

在 1000 万以内的任意范围内随机生成质数——用于数学练习、谜题或测试。

  • 在浏览器中生成
  • 公平的密码学随机
  • 一键全部复制

你的质数

在你的浏览器中生成。按空格键再生成一次。

随机质数 API

以 JSON 获取随机质数结果。接口只读,少量使用无需 API 密钥,并支持跨域请求。

GET/api/v1/tools/random-prime
curl https://randnext.com/api/v1/tools/random-prime?min=2&max=1000&count=5

参数

参数类型作用(英文)默认值 / 允许的值
minintegerLowest prime number that may be returned, inclusive.默认:22 到 1000000
maxintegerHighest prime number to search, inclusive. The API limit is 1,000,000.默认:10002 到 1000000
uniquebooleanWhen true, the response will not contain the same prime twice.默认:truetrue 或 false
countintegerNumber of results to return.默认:11 到 50
查看参数、响应和限制 →

你可能还喜欢

使用方法

  1. 1设定范围。
  2. 2选择质数的数量。
  3. 3点“生成”。

常见问题

这些真的是质数吗?

是的。我们用筛法列出范围内的全部质数,再从中抽取,所以每个质数的机会都相同。

真的是随机的吗?

是的。数值来自浏览器的密码学安全随机源,每个可能的值机会都相同。