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
- Prepare lower prime, upper prime, using the input definitions and matching units below.
- Enter the required fields and run Prime Gap Calculator.
- Read result.exactConsecutivePrimeGap using the units, signs and ordering explained below.
- Correct any rejected inputs and rerun; interpret the result within the stated model and its assumptions.
| Input field | Meaning | Value type | Requirement |
|---|---|---|---|
| actualLowerPrime | Actual Lower Prime. Use the units and matching context stated in the calculation below. | number | Required; integer 2–1000000; finite; other constraints below |
| actualUpperPrime | Actual Upper Prime. Use the units and matching context stated in the calculation below. | number | Required; 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 field | Meaning | Value type |
|---|---|---|
| result | Object containing the calculated or selected fields below. | object |
| result.exactConsecutivePrimeGap | Exact positive difference between the verified consecutive primes. | number |
{
"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
-
Prime Gap Calculator — tool.io
Similar or alternative tools
- Wieferich Pair Checker
A mutual Wieferich pair requires two distinct primes satisfying both directions of a modular-power condition.
- Twin Prime Conjecture Checker
A finite list of twin-prime pairs cannot settle an assertion about infinitely many pairs.