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.

Description

Sexy-prime pairs are primes separated by six.

Sexy-prime pairs are primes separated by six. The name refers to the Latin word for six, and the predicate needs both primality and the specified spacing.1

The tool returns isSexyPair. The indexing and output conventions below determine how to read these values.

When to use Sexy Prime Pair Checker

Use this for the following task: Check whether two nonnegative integers are prime and differ by six, 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 Sexy Prime Pair Checker and understand its results

  1. Choose the required indexes, integers or sequence entries. Preserve decimal-string encodings where the field table specifies strings.
  2. Enter first, second according to the field table, then run the tool.
  3. Read isSexyPair. A true flag means the candidate meets the stated property; false means it does not.
  4. If the flag is false, review the candidate and definition. A well-formed nonmember is different from a rejected input.
Input fieldMeaningValue type and boundsRequirement
firstFirst candidate (resource limit 10^12)integer; minimum 0; maximum 1000000000000Required
secondSecond candidate (resource limit 10^12)integer; minimum 0; maximum 1000000000000Required

Accept either order, check the absolute difference and use deterministic trial-division primality checks for both bounded candidates.

pair = prime(first) AND prime(second) AND |first−second|=6

The symbols and boundary conditions refer to the supplied fields and the implementation described above.

Output fieldMeaningValue type
isSexyPairWhether the candidates are sexy primesboolean
json
{
  "input": {
    "first": 11,
    "second": 17
  },
  "output": {
    "isSexyPair": true
  }
}

Limitations and assumptions

Each candidate is at most 10¹². The tool checks two integers, without finding longer progressions or nearby pairs.

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 Cousin Prime Pair Checker for the complementary operation: Check whether two nonnegative integers are prime and differ by four, accepting either order and limiting each candidate to 10¹² for trial division.

Background reference: OEIS A023201.

References

  1. OEIS A023201 — 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.

  • 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.

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