Function Repository Resource:

SophieGermainPrimeQ

Source Notebook

Determine whether a number is a Sophie Germain prime

Contributed by: Arnoud Buzing

ResourceFunction["SophieGermainPrimeQ"][p]

gives True if p is a Sophie Germain prime and False otherwise.

Details and Options

A Sophie Germain prime is a prime number q such that 2q+1 is also prime. Here, 2q+1 is referred as a safe prime.

Examples

Basic Examples (3) 

11 is a Sophie Germain prime, because both 11 and 23=2·11+1 are primes:

In[1]:=
ResourceFunction["SophieGermainPrimeQ"][11]
Out[1]=

7 is not a Sophie Germain prime, because 15=2·7+1 is not prime:

In[2]:=
ResourceFunction["SophieGermainPrimeQ"][7]
Out[2]=

Even though 29=2·14+1 is a prime number, 14 is not a Sophie Germain prime because it is not prime itself:

In[3]:=
ResourceFunction["SophieGermainPrimeQ"][14]
Out[3]=

Publisher

Arnoud Buzing

Version History

  • 1.0.0 – 29 April 2020

Related Resources

License Information