Function Resource

StrongPrimeQ

Determines if the given number is a strong prime, or not

ResourceFunction["StrongPrimeQ"][p]

gives True if p is a strong prime and False otherwise.

Details and Options

StrongPrimeQ uses the number theoretic definition of a strong prime, not the cryptographic one.
StrongPrimeQ returns True if the given prime is greater than the arithmetic average of its nearest prime above and below it.

Examples

Basic Examples

The prime number 457 is strong:

In[1]:=
ResourceFunction[ "https://www.wolframcloud.com/obj/arnoudb/DeployedResources/Function/\
StrongPrimeQ"][457]
Out[1]=

It is bigger than the average of its preceding and succeeding primes:

In[2]:=
PrimePi[457]
Out[2]=
In[3]:=
Prime[87]
Out[3]=
In[4]:=
Prime[89]
Out[4]=
In[5]:=
457 > (449 + 461)/2
Out[5]=