Function Repository Resource:

TwinPrime

Source Notebook

Find the nth twin prime

Contributed by: Wolfram|Alpha Math Team

ResourceFunction["TwinPrime"][n]

returns the nth twin prime number.

Details and Options

A twin prime is a prime number with distance two from another prime number, considered its "twin".
For each pair, ResourceFunction["TwinPrime"] returns the smaller of the two.

Examples

Basic Examples (2) 

Find the 10th twin prime:

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

Find the first 10 twin primes:

In[2]:=
ResourceFunction["TwinPrime"] /@ Range[10]
Out[2]=

Publisher

Wolfram|Alpha Math Team

Version History

  • 2.0.0 – 23 March 2023
  • 1.0.0 – 31 March 2020

Related Resources

License Information