Function Repository Resource:

SexyPrimes

Source Notebook

Get the pairs of primes that differ by 6

Contributed by: Wolfram Staff

ResourceFunction["SexyPrimes"][n]

gives the first n pairs of primes that differ by 6.

Examples

Basic Examples (3) 

Here are the first 10 pairs of sexy primes:

In[1]:=
ResourceFunction["SexyPrimes"][10]
Out[1]=

Indeed, the differences are 6:

In[2]:=
Differences /@ %
Out[2]=

For reference, here are the first 20 primes:

In[3]:=
Prime[Range[15]]
Out[3]=

Publisher

George Beck

Version History

  • 2.0.0 – 05 July 2019
  • 1.0.0 – 22 May 2019

Related Resources

License Information