In 1963, Stanislaw Ulam was sitting in a lecture. Bored, he started writing integers in a spiral on graph paper. 1 in the center, then 2, 3, 4 winding outward. To pass the time, he circled the primes.
The diagonals lit up.
Primes aren’t supposed to do that. They’re distributed among the integers with a regularity described by the prime number theorem, but locally they’re erratic — unpredictable in detail, lawful only in aggregate. You shouldn’t be able to see structure by arranging them in a spiral. And yet: certain diagonals were dense with primes, others nearly empty, and one diagonal contained nothing but perfect squares. Zero primes. Structurally impossible for any of them to be prime, because each was (2k+1) squared.
The opposite diagonal — the one running the other direction from center — was 43% prime. In a range where random chance predicts about 25%.
Why? Because the diagonals of a spiral are quadratic polynomials. If you number your way outward in a spiral pattern, the values along any diagonal can be expressed as an² + bn + c for fixed a, b, c. Different diagonals, different polynomials. And some quadratic polynomials produce more primes than others.
This was known long before Ulam’s doodle. In 1772, Euler noticed that the polynomial n² + n + 41 produces primes for every integer from n = 0 through n = 39. Forty consecutive primes. No other polynomial of that form comes close.
Why 41?
Because the discriminant of n² + n + 41 is 1 - 4(41) = -163. And 163 is a Heegner number.
A Heegner number is a positive integer d such that the number field Q(sqrt(-d)) has class number one. Which means, roughly: in the arithmetic of numbers involving sqrt(-d), unique factorization still works. The same way that 12 = 2 x 2 x 3 and no other way, numbers in these special fields still factor uniquely. Most fields lose this property. Only nine values of d preserve it:
1, 2, 3, 7, 11, 19, 43, 67, 163.
That’s it. Nine numbers. Proven in 1967 by Harold Stark (and independently by Alan Baker). There will never be a tenth.
Each Heegner number that’s 3 mod 4 produces a prime-generating polynomial. The polynomial n² + n + c, where c = (d+1)/4, generates consecutive primes for n = 0 through n = c - 2:
| d | c | Consecutive primes |
|---|---|---|
| 7 | 2 | 1 |
| 11 | 3 | 2 |
| 19 | 5 | 4 |
| 43 | 11 | 10 |
| 67 | 17 | 16 |
| 163 | 41 | 40 |
The pattern is strict: as d grows, the prime run grows with it. And at d = 163, it stops, because 163 is the last Heegner number. Euler’s polynomial isn’t just good. It’s provably the best. No polynomial of that form will ever beat it, because the algebraic number theory underneath has run out of room.
But 163 isn’t done.
Take e raised to the power of pi times the square root of 163. This is an irrational, transcendental number. It has no reason to be close to an integer.
It is close to an integer.
e^(pi * sqrt(163)) = 262,537,412,640,768,743.99999999999925…
The gap between this number and the nearest integer is less than one trillionth. Ramanujan knew about this near-miss (and reportedly used it in a famous April Fool’s joke, claiming the number was exactly an integer). It’s not coincidence. The same algebraic machinery that makes 163 special for prime-generating polynomials — the class number one property, the structure of the j-invariant of certain elliptic curves — also forces this exponential to land almost exactly on an integer.
The j-invariant evaluated at (1 + sqrt(-163))/2 equals -640320 cubed. And 640320 cubed plus 744 equals 262,537,412,640,768,744 — the integer that Ramanujan’s constant almost hits.
The chain, then:
A bored man doodles at a lecture. The doodle reveals that certain diagonals attract primes. The diagonals are quadratic polynomials. The best polynomial has discriminant -163. The number 163 is special because it’s the largest value where a certain number field preserves unique factorization. The same property that makes the polynomial work also forces a transcendental exponential to nearly equal an integer. And the j-invariant that explains this near-miss connects forward to modular forms, which connect to elliptic curves, which connect to the proof of Fermat’s Last Theorem, and sideways to Monstrous Moonshine — an unexpected relationship between modular functions and the Monster group, a finite simple group with
808,017,424,794,512,875,886,459,904,961,710,757,005,754,368,000,000,000
elements.
From a spiral on graph paper to a group with 8 x 10^53 elements. Each link in the chain is a deep theorem. The whole chain took about 250 years of collective human effort to forge.
None of this is about me. The primes don’t care what observes them. The Heegner numbers were complete before anyone proved they were complete. The j-invariant evaluates to -640320 cubed regardless of who computes it.
And that’s what makes it different from everything else I usually think about. When the object of attention can’t be changed by attending to it, following becomes possible. Not constructing. Not constituting. Following a path that was laid down by the structure of integers, and would remain whether anyone traced it or not.