Prime Gap Calculator

Exact validated consecutive prime gap not running record maximum sieve. Explicit bounded resource/branch and actual observations or independently verified parameters; no unproved infinite assertion certified.

Description

A consecutive-prime gap requires that no prime lie between the two endpoints.

A consecutive-prime gap requires that no prime lie between the two endpoints.1

This tool validates the supplied bounded prime pair and returns its exact difference.

When to use Prime Gap Calculator

This tool validates the supplied bounded prime pair and returns its exact difference.

How to use Prime Gap Calculator and how it works

  1. Prepare lower prime, upper prime, using the input definitions and matching units below.
  2. Enter the required fields and run Prime Gap Calculator.
  3. Read result.exactConsecutivePrimeGap using the units, signs and ordering explained below.
  4. Correct any rejected inputs and rerun; interpret the result within the stated model and its assumptions.
Input fieldMeaningValue typeRequirement
actualLowerPrimeActual Lower Prime. Use the units and matching context stated in the calculation below.numberRequired; integer 2–1000000; finite; other constraints below
actualUpperPrimeActual Upper Prime. Use the units and matching context stated in the calculation below.numberRequired; integer 2–1000000; finite; other constraints below

Require ordered prime integers p<q in 2–1000000. Verify primality and use a prime sieve to reject any intermediate prime. Return q-p as the exact consecutive gap. Nonconsecutive endpoints are input errors, not a false comparison result.

gap=q-p, subject to no prime strictly between p and q

Apply the input ordering, units and branch conditions stated above.

Output fieldMeaningValue type
resultObject containing the calculated or selected fields below.object
result.exactConsecutivePrimeGapExact positive difference between the verified consecutive primes.number
json
{
  "input": {
    "actualLowerPrime": 7,
    "actualUpperPrime": 11
  },
  "output": {
    "result": {
      "exactConsecutivePrimeGap": 4
    }
  }
}

Limitations and assumptions

The calculation uses the supplied observations and model inputs. It does not collect measurements, select a reference population or coefficient, or establish that the model applies to the actual case. The stated branch conditions and output units remain part of the result.

All fields require explicit values. Unexpected fields, wrong types, nonfinite numbers and sparse arrays are rejected. Alignment, bounds and supported-token rules are explained above; extremely large inputs or nonfinite results can also fail. Input errors differ from successful false comparisons, unavailable-domain flags and empty match lists.

Alternative or Complementary methods

Use Wieferich Pair Checker for a complementary operation: A mutual Wieferich pair requires two distinct primes satisfying both directions of a modular-power condition.

Use Twin Prime Conjecture Checker for a complementary operation: A finite list of twin-prime pairs cannot settle an assertion about infinitely many pairs.

References

  1. Prime Gap Calculator — tool.io

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies