Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Give the greatest gap between the primes up to the argument
ResourceFunction["LargestPrimeGap"][arg] gives the largest difference between primes up to arg, which must be at least 3. |
Here are the primes up to 13:
| In[1]:= |
| Out[1]= |
The largest gap is between 7 and 11:
| In[2]:= |
| Out[2]= |
The function is nondecreasing:
| In[3]:= |
| Out[3]= | ![]() |
Although the gaps are unbounded, they rise slowly:
| In[4]:= |
| Out[4]= |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License