Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get the pairs of primes that differ by 4
ResourceFunction["CousinPrimes"][n] gives the first n pairs of primes that differ by 4. |
Here are the first 10 pairs of cousin primes:
In[1]:= | ![]() |
Out[1]= | ![]() |
Indeed, the differences are 4:
In[2]:= | ![]() |
Out[2]= | ![]() |
The sum of the reciprocals of the primes diverges:
In[3]:= | ![]() |
Out[3]= | ![]() |
The sum of the reciprocals of the cousin primes converges to a number around 1.673. Here is the sum of the reciprocals of the first 100,000 cousin primes:
In[4]:= | ![]() |
Out[4]= | ![]() |
This is the last pair in that sum:
In[5]:= | ![]() |
Out[5]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License