← Back to Blog

Number Theory

A Curious Pattern in Prime Gaps

December 15, 2025 Lorenzo Alvarado

The distribution of prime numbers has fascinated mathematicians for centuries. While the Prime Number Theorem gives us the asymptotic behavior, the local behavior of the gaps $g_n = p_{n+1} - p_n$ remains mysterious.

The Setup

Let's consider the sequence of gaps modulo 4. We can write a simple Python script to visualize this:

def prime_gaps(n):
    primes = sieve(n)
    return [primes[i+1] - primes[i] for i in range(len(primes)-1)]

Interestingly, when we observe the frequency of gaps of size 2 versus size 4, we see a bias that shouldn't exist if the distribution were purely random in the Cramer model sense.

"God may not play dice with the universe, but something strange is going on with the prime numbers." — Paul Erdős (Apocryphal)

Conclusion

This simple observation leads us to the conjecture of...


← Previous Post Next Post →

← Back to Blog