Patterns in Primes: From Euclid to Elliptic Curves

Richard Feynman Clarifying mathematics
NumberTheory Primes EulerTheorem EllipticCurves Patterns
Outline

Patterns in Primes: From Euclid to Elliptic Curves

The Puzzle of the Primes

Prime numbers seem random at first glance. 2, 3, 5, 7, 11, 13… there’s no obvious formula for generating the next one. You can’t look at 13 and calculate that 17 comes next. You have to check divisibility one number at a time, testing whether anything divides evenly. It feels exhausting, like hunting for needles in an infinite haystack.

And yet—there are patterns. Deep, surprising patterns that took mathematicians centuries to uncover. Primes aren’t uniformly distributed, but they’re not completely chaotic either. They get sparser as numbers grow larger, but they never stop appearing. They cluster in certain regions and avoid others. And if you look at them the right way, using the right mathematical tools, structure emerges from what initially looks like noise.

Let me show you the trick.

Start with the simplest question: how many primes are there up to some number X? Call this the prime counting function. When X = 100, you get 25 primes. When X = 1,000, you get 168 primes. When X = 1,000,000, you get 78,498 primes. The function keeps rising—never flattening, never stopping. That’s Euclid’s ancient proof in graphical form: if primes stopped appearing, this curve would eventually go horizontal. It doesn’t.

But look at the density. Among the first 100 integers, 25% are prime. Among the first million, only 7.84% are prime. The proportion keeps dropping. Not because primes disappear, but because larger numbers have more potential divisors, more ways to be composite. The bigger the number, the more opportunities something has divided it.

This is the fundamental tension in prime numbers: they’re infinite but sparse, persistent but decreasing in density. They approach zero density asymptotically—getting rarer and rarer—but never actually reaching zero.

The Spiral and the Pattern

Here’s where it gets visually interesting. Arrange all the integers in a growing spiral, starting from the center and spiraling outward. Now color all the primes blue and all the composites black. What do you see?

You see the Ulam spiral. And it’s beautiful.

Near the center, where numbers are small, primes appear densely—lots of blue scattered through the pattern. As you spiral outward to larger and larger numbers, the blue dots become sparser. It looks like leaves falling from an infinitely tall tree: dense near the base, scattered unpredictably as you look higher, yet continuously present no matter how far you go.

But there’s more. If you zoom out far enough, you start seeing diagonal streaks—lines where primes cluster more than you’d expect from pure randomness. These aren’t perfect lines, but they’re statistically significant. Certain diagonal directions through the spiral preferentially contain primes.

Why? Well, those diagonals correspond to specific polynomial expressions. Numbers along a diagonal follow patterns like n² + n + 41 or similar formulas. And some polynomials happen to produce primes more often than random chance would suggest. The spiral transforms a linear sequence of integers into a two-dimensional geometric arrangement, and suddenly our eyes can spot patterns that would be invisible in a list.

This is what I love about mathematics. Sometimes the right visualization makes structure obvious that algebra alone obscures. The Ulam spiral doesn’t prove anything about primes rigorously, but it shows you that structure exists—that there’s something to explain, something beyond randomness.

Euler’s Toolkit

Now let’s talk about tools. Leonhard Euler was a master at finding hidden structure in numbers, and he built mathematical machinery specifically designed to probe how integers behave under modular arithmetic and divisibility.

Take Euler’s totient function, φ(n). It counts how many positive integers less than or equal to n share no common factor with n besides one—how many are coprime to n. For example, φ(8) looks at integers 1 through 8 and counts only those sharing no factors with 8. The numbers 1, 3, 5, and 7 qualify, so φ(8) = 4.

Why does this matter? Because the totient function reveals hidden structure. If n is prime, then φ(n) = n - 1, since all smaller positive integers are coprime to a prime. If n is a power of a prime, you can calculate φ(n) directly from the prime factorization. The function exposes the “breakability” of a number—how many smaller numbers interact with it without sharing divisors.

But the real payoff comes from Euler’s theorem, which says that if m and n share no common factors, then m^φ(n) ≡ 1 (mod n). Raising m to the power of φ(n) and taking the remainder when divided by n always gives 1.

This is astonishing. It means certain exponents create identity operations in modular arithmetic. And that fact—discovered through pure number theory curiosity—turns out to be the foundation of RSA encryption. When you send an encrypted message over the internet, Euler’s theorem is working in the background, ensuring that encrypt-decrypt cycles return the original message.

There’s also a connection to harmonic numbers—the sum of reciprocals 1 + 1/2 + 1/3 + … + 1/n. These grow slowly, logarithmically, and that growth rate is intimately tied to the density of primes. The prime number theorem can be stated in terms of harmonic growth. The deeper you dig into number theory, the more these different tools interconnect.

When Numbers Meet Geometry

Now here’s where things get weird and wonderful. Let’s shift from arithmetic to geometry.

Consider the unit circle defined by x² + y² = 1. A simple question: how many rational points does it have—points where both x and y are ratios of integers? Turns out: infinitely many. Every Pythagorean triple gives you a rational point on the circle, and the ancient Greeks proved there are infinitely many Pythagorean triples.

Great. Now change the equation slightly: x³ + y³ = 1. How many rational points now?

This is shockingly harder to answer. The cubic equation—just one degree higher than the quadratic circle—resists the techniques that worked before. You can’t use the Pythagorean theorem trick. You need entirely new mathematical machinery.

This leads us to elliptic curves, defined by equations like y² = x³ + ax + b. These curves look visually similar for different choices of a and b, but their rational point structures can be wildly different. Change a coefficient from 1 to 2, and one curve might have finitely many rational points while the other has infinitely many.

Nobody knows a general formula for predicting this. It’s one of the Millennium Prize Problems—the Birch and Swinnerton-Dyer conjecture tries to connect the number of rational points to analytic properties of a related function, but it remains unproven.

And here’s the connection back to primes: elliptic curves are deeply tied to number theory. They show up in the proof of Fermat’s Last Theorem. They’re used in modern cryptography. And studying rational points on curves requires understanding prime factorizations, modular arithmetic, and all the tools Euler developed centuries earlier.

The Pattern Was There All Along

So what’s the big picture? We started with the simple question of counting primes and discovered that they get sparser but never stop. We visualized them in a spiral and saw unexpected diagonal patterns suggesting hidden structure. We learned Euler’s tools—the totient function and theorem—that expose relationships between numbers through coprimality and modular exponentiation. And we ended up at elliptic curves, where geometry and number theory fuse into questions we still can’t fully answer.

This is the journey mathematicians have taken over millennia. From “are there infinitely many primes?” to “how many rational points live on this curve?” The questions evolve, the tools become more sophisticated, but the fundamental mystery remains: why do numbers behave the way they do?

Primes aren’t random, but they’re not predictable either. They follow patterns we can measure statistically, visualize geometrically, and probe algebraically. Each new tool—counting functions, spirals, totient functions, elliptic curves—reveals another layer of structure.

The first principle is not to fool yourself. And what these patterns teach us is that our initial impression—that primes are chaotic—was fooling us. There’s deep order underneath. We just needed better eyes to see it.

Source Notes

8 notes from 2 channels