One of my niche hobbies is finding primes; large, small, all 1s, after highly composite number, with large gaps. A silly meme from the Mersenne prime finding community is that the best way to find a big prime is to go on vacation. The meme originated when the lead of the GIMPs was on vacation several times when new mersenne primes have been found. Well I went on vacation this weekend to enjoy the San Jaun Islands and I found a great prime while gone.
63903043264992920397003664983710359009089377381540642869811776882897115763707305983959954524183115592959854860408206096893879274256761028558136301 has the fun property that the next 14281 numbers are all composite. How rare is this? 1 in a quadrillion! The “merit” of a prime gap is measured as gap / log(n) which in this case is 42.54, this is the largest gap by merit ever found (more on this in the thread) theoretically the gap after a prime is this large after 1 in a quadrillion primes (e.g. You have to check after 2^42 gaps to find something like this) but in practice it’s more like 1 in 240 quadrillion.
Overall A+ vacation. The weather was beautiful; I saw some “whales” (porpoises) and found a new record in a favorite math project.
The prime gap project is having an amazing year. Before this month the previous record was found in 2017 by gapcoin and the last change to the top three was in 2021. I found a 3rd place record last month, then another participant eclipsed that by finding a new 2nd best, then another person found five new records including a new 1st place only to be eclipsed a week later by the record I just found.
This all started for me because someone stalled a speedup to gmp_nextprime that I was trying to submit by asking if I could speed up a slow test case I had added that checked what happened if the gap to the next prime was larger than the max of a uint16_t. That lead me to searching for the smallest prime with a gap > 65,535 and sealed my fate. Ultimately that PR took over a year so I’m pretty happy here in Colab.
How did I find the number? It can also be written as “6213645659191 * 337# / 210 - 7908” where 337# = 235711…337. This causes the primes less than 337 to better “cover” nearby numbers; in practice this gives you a 1-2 merit boost meaning I only searched 1.2e12 ranges instead of the theoretical 2.4e14 ranges. Each X * 337#/210 gets sieved then tested on a GPU. Some clever data structures and handling makes this ~100x faster and modern GPUs can test ~10M primes per second.