Sophie Germain Calculator

Sophie Germain test with safe pair.

Math and PercentUpdated 2026-10-131 min read
Sophie Germain Calculator
Primality
...
Verdict...
Pair...

What it does

Sophie Germain primes double safely: p is prime and 2p+1 is prime too, guarding cryptographic groups with extra structure. Eleven pairs 23 in the classic small case.

The tool above takes n. It returns primality with the Sophie verdict and pair value.

The default 11 reads prime and Sophie Germain with 23 prime. The 7 case reads prime but not Sophie since 15 composites, and 9 reads composite.

Prime references define the form with sequence tables starting 2, 3, 5, 11, 23. Trial division to the root decides both numbers exactly in range.

Safe primes matter where discrete logarithms guard secrets: Diffie-Hellman groups prefer them. Infinitude stays open while lists keep growing.

How to use

  1. Type n from 2 up.
  2. Read prime or composite first.
  3. Read the Sophie verdict beside it.
  4. Read the pair value last.
  5. Use safe pairs for crypto.
  6. Respect the input cap.

Formula

Prime p with 2p+1 prime. Trial division to root n.
n
Candidate from 2 up.
2n+1
Double plus one pair.

Prime number references define Sophie Germain primes with the 2p+1 safe pair construction. OEIS tabulates the sequence starting 2, 3, 5, 11, 23. Trial division to the square root decides both numbers exactly in range.

Worked example

Example: is 11 Sophie Germain

Default: n = 11.

  1. Number: 11.
  2. Prime: divisible only by 1 and 11.
  3. Pair: 2 x 11 + 1 = 23, also prime.
  4. Verdict: Sophie Germain with safe pair.
  5. Check: 23 guards Diffie-Hellman groups.
  6. Tool shows Prime, Sophie Germain (safe pair), 2x11+1 = 23 prime.

Reference table

Small Sophie Germains
p2p+1Safe
25Yes
37Yes
511Yes
1123Yes
715No

Limits

  • Trial division speed caps.
  • Single n per run.
  • Safe use needs full crypto.
  • Infinitude unproven.

Common mistakes

  • Testing pair before prime.
  • Reading safe as unbreakable.
  • Skipping the 2n+1 check.
  • Trusting huge odds blindly.
  • Confusing prime families.

Try it yourself

Quick checks. Answers sit tucked under each question.

n = 7?

Prime but 15 composites: prime, not Sophie Germain.

n = 9?

Composite: no Sophie test applies.

n = 2?

Prime with 5 prime: Sophie Germain safe pair.

n = 1?

Under 2 primes nothing: enter 2 up.

Questions

Sophie Germain meaning?

Prime p where 2p+1 is also prime. 11 pairs 23, 2 pairs 5.

Used where?

Cryptography favors them: safe primes structure Diffie-Hellman groups.

Pair first?

No, first proves primality, then tests the pair. Composites skip both.

Test method?

Yes, trial division to the root here, capped for page speed.

Infinite many?

No, infinitude stays unproven. Lists grow but never guarantee the next.

Same as others?

No, cousins, sexy, and Mersenne primes follow other forms. Each needs its own check.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.