Sophie Germain Prime Checker

Check whether both p and 2p+1 are prime by deterministic trial division, with p capped at 10¹² for bounded work.

Description

A Sophie Germain prime p has a corresponding prime 2p+1.

A Sophie Germain prime p has a corresponding prime 2p+1. The latter is called a safe prime, giving two related but differently parameterized tests.1

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

When to use Sophie Germain Prime Checker

Use this for the following task: Check whether both p and 2p+1 are prime by deterministic trial division, with p capped at 10¹² for bounded work. Use the input and output conventions below to reproduce the intended mathematical quantity.

How to use Sophie Germain Prime 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 p according to the field table, then run the tool.
  3. Read isSophieGermain. 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
pCandidate prime (trial-division resource limit 10^12)integer; minimum 0; maximum 1000000000000Required

Test the supplied p and the derived integer 2p+1 by deterministic trial division. A failed primality condition returns false.

Sophie Germain(p) ⇔ prime(p) AND prime(2p+1)

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

Output fieldMeaningValue type
isSophieGermainWhether p is a Sophie Germain primeboolean
json
{
  "input": {
    "p": 23
  },
  "output": {
    "isSophieGermain": true
  }
}

Limitations and assumptions

The caller supplies p, capped at 10¹². The tool does not generate primes or make a cryptographic suitability assessment.

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 Safe Prime Checker when you need its operation: Check whether p is prime and (p−1)/2 is prime, with p capped at 10¹² for bounded trial division. Choose Twin Prime Pair Checker for the complementary operation: Check whether two nonnegative integers are prime and differ by two, accepting either order and limiting each candidate to 10¹² for trial division.

Background reference: OEIS A005384.

References

  1. OEIS A005384 — OEIS Foundation

Similar or alternative tools

  • Safe Prime Checker

    Check whether p is prime and (p−1)/2 is prime, with p capped at 10¹² for bounded trial division.

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

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