跳转到主要内容
Calcton

Prime Gaps Calculator

Free online prime gaps calculator. Enter your values and get instant results with the formula, step-by-step working, a worked example and FAQs — everything runs locally in your browser on Calcton, no signup required.

中文版:素数间隙在线计算器

Prime Gaps Calculator
区间起点 a(≥ 1)
区间终点 b(≤ 1000000,b−a ≤ 200000)

原理:相邻素数之差称为素数间隙。平均间隙随位置增长:在 x 附近约为 ln x(素数定理的直接推论),但局部起伏巨大——1 到 100 的平均间隙 ≈ 3.958333333333,最大间隙 8(89 → 97);到 10¹⁸ 附近已发现超过 1500 的间隙。孪生素数猜想断言间隙 = 2 出现无穷多次,而波利尼亚克猜想把它推广到任意偶间隙;张益唐 2013 年证明存在无穷多个小于 7000 万的间隙,目前界已压到 246。

步骤:输入区间 [a, b],工具用埃拉托斯特尼筛生成 ≤ b 的素数表,过滤出区间内素数,统计个数、首末位置、最大间隙及其全部出现位置、平均间隙与孪生对数。

示例:[2, 50] 内 15 个素数,最大间隙 6(23→29、31→37),平均 3.214285714286;[1, 100] 内 25 个素数,最大间隙 8(89→97),平均 3.958333333333;1 到 100 有 8 对孪生素数,1 到 500 有 24 对。

注意事项:区间跨度上限 200000(筛法内存与耗时控制);a ≥ 1 时区间从 2 开始筛,单个素数(区间内不足 2 个)无法定义间隙;最大间隙可能并列出现,工具列出全部位置;「孪生素数」按相邻素数差 = 2 计数,(3,5) 与 (5,7) 共享 5 各算一对。

相关:孪生素数与素数计数工具给出间隙理论的两个端点;素数分类工具从性质分类看整数;威尔逊定理与二次剩余工具提供素数判定的代数视角;质因数分解工具展示间隙之间的合数结构。

How to use the Prime Gaps Calculator

  1. Fill in the inputs with your own numbers — every field shows what it expects.
  2. The result updates instantly as you type; no "Calculate" click needed.
  3. Read the result card for the main figure, the step-by-step formula, and practical notes.

Frequently asked questions

Is the Prime Gaps Calculator free?

Yes — all math calculators on Calcton are free, with no sign-up required. Your inputs are processed in your browser and never sent to a server.

Is there a Chinese version of this tool?

Yes. Use the Chinese version link above — it is the same calculator with the interface in Simplified Chinese.

References

Formulas and benchmarks used by this calculator follow these published sources.

  1. dlmf.nist.gov
  2. mathworld.wolfram.com
Kevin's profile

KevinContent LeadCalcton Editorial Team · Last updated 2026-10-02

Kevin maintains Calcton's formula verification and content: every calculator cites the standard it implements, worked examples are recomputed programmatically, and health benchmarks follow WHO and international guidelines.

Related calculators

More in this category: Math calculators

About math calculators

Free online math calculators for algebra, statistics, number theory and everyday arithmetic — from quadratic equations and matrices to percentages, fractions and prime factorization, each with step-by-step formulas.

搜索计算器

搜索全站计算器、分类与页面,回车直达