Cousin Prime Pair Checker
Check whether two nonnegative integers are prime and differ by four, accepting either order and limiting each candidate to 10¹² for trial division.
Description
Cousin-prime pairs contain two primes separated by four.
Cousin-prime pairs contain two primes separated by four. The pair’s order does not change this property.1
The tool returns isCousinPair. The indexing and output conventions below determine how to read these values.
When to use Cousin Prime Pair Checker
Use this for the following task: Check whether two nonnegative integers are prime and differ by four, accepting either order and limiting each candidate to 10¹² for trial division. Use the input and output conventions below to reproduce the intended mathematical quantity.
How to use Cousin Prime Pair Checker and understand its results
- Choose the required indexes, integers or sequence entries. Preserve decimal-string encodings where the field table specifies strings.
- Enter first, second according to the field table, then run the tool.
- Read isCousinPair. A true flag means the candidate meets the stated property; false means it does not.
- If the flag is false, review the candidate and definition. A well-formed nonmember is different from a rejected input.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| first | First candidate (resource limit 10^12) | integer; minimum 0; maximum 1000000000000 | Required |
| second | Second candidate (resource limit 10^12) | integer; minimum 0; maximum 1000000000000 | Required |
Check the absolute difference and use deterministic trial-division primality tests for the two nonnegative bounded integers.
cousin pair ⇔ prime(first) AND prime(second) AND |first−second|=4 The symbols and boundary conditions refer to the supplied fields and the implementation described above.
| Output field | Meaning | Value type |
|---|---|---|
| isCousinPair | Whether the candidates are cousin primes | boolean |
{
"input": {
"first": 7,
"second": 11
},
"output": {
"isCousinPair": true
}
} Limitations and assumptions
Each candidate is at most 10¹². No prime pair is searched for or generated.
Use the declared integer bounds and string formats. Large exact outputs remain decimal strings; numerical approximations use ordinary floating-point arithmetic. A rejected input is different from a valid zero count or false membership flag.
Alternative or Complementary methods
Choose Twin Prime Pair Checker when you need its operation: Check whether two nonnegative integers are prime and differ by two, accepting either order and limiting each candidate to 10¹² for trial division. Choose Sexy Prime Pair Checker for the complementary operation: Check whether two nonnegative integers are prime and differ by six, accepting either order and limiting each candidate to 10¹² for trial division.
Background reference: OEIS A023200.
References
-
OEIS A023200 — OEIS Foundation
Similar or alternative tools
- Twin Prime Pair Checker
Check whether two nonnegative integers are prime and differ by two, accepting either order and limiting each candidate to 10¹² for trial division.
- Sexy Prime Pair Checker
Check whether two nonnegative integers are prime and differ by six, accepting either order and limiting each candidate to 10¹² for trial division.