In 1914 Ramanujan published this, with no derivation:
$$\frac{1}{\pi} \;=\; \frac{2\sqrt 2}{9801}\sum_{n=0}^{\infty}\frac{(4n)!\,(1103 + 26390\,n)}{(n!)^4\,396^{4n}}$$Take just the first term — set $n = 0$, so the sum is only $1103$ — and you get $1/\pi$ correct to eight decimal places. Add the next term, sixteen places. The one after that, twenty-four. Eight more digits every single time, forever.
Nobody beat it for seventy years.
Before we go anywhere, look at the two strange numbers sitting in it. There is 9801 out in front. There is 396 buried in the denominator. Nothing about the formula explains why those and not others.
Keep them in mind. We are going to walk away from this formula entirely, and when we come back they will be waiting.
Forget $\pi$ for a moment.
There is a function called the elliptic modulus, written $k(q)$. You build it by dividing one infinite sum by another. It is the kind of object that has no closed form, takes ugly values, and does not simplify.
Now do something arbitrary-looking to it. Pick a whole number — say $58$ — and evaluate $k$ at the point $q = e^{-\pi\sqrt{58}}$. Square the answer and call it $\alpha_{58}$.
You have taken a transcendental function and fed it a transcendental input. You should get mud.
Here is what you get:
$$\alpha_{58} = (13\sqrt{58} - 99)^2\,(99 - 70\sqrt 2)^2$$Square roots and whole numbers. The infinite sums are gone. You can check it: grind the theta series out to 120 digits, evaluate those radicals separately, and the two agree to eighty places.
That is already surprising. But look at what is in there.
99. Twice.
Go back and look at the two numbers we were told to remember.
$$9801 = 99^2, \qquad\qquad 396 = 4 \times 99$$So a formula for $\pi$ and a value of an elliptic function — two things with no visible connection — are both built out of 99.
Either that is an accident, or these are the same object seen from two sides. The rest of this chapter is finding out which.
From $\alpha_{58}$ you can build a related quantity called the class invariant:
$$g_{58}^{12} = \frac{(k')^2}{2k}, \qquad k' = \sqrt{1-\alpha}, \quad k = \sqrt{\alpha}$$Compute it. Here is what comes out:
$$g_{58}^{12} = 19601.99999489847\ldots$$Stop on that for a second.
It is almost a whole number. Not quite. Five decimal places of agreement and then it drifts. If you were sloppy you would write down 19602 and move on, and you would have invented something.
So why is it so close? A number that misses an integer by five parts in a million is not doing that by chance.
There is 99 a third time — $9801$ again, now as the whole-number part of something irrational.
And this is not a random expression. It is $\varepsilon^6$, where
$$\varepsilon = \frac{5+\sqrt{29}}{2}$$is the fundamental unit of $\mathbb{Q}(\sqrt{29})$ — roughly, the smallest multiplicative building block of that number system, the thing every other unit is a power of.
Units have a norm: multiply the number by its conjugate. For $\varepsilon$ that norm is $-1$. So for $\varepsilon^6$ it is $(-1)^6 = +1$.
Write that out. Norm $+1$ for $9801 + 1820\sqrt{29}$ says:
$$9801^2 - 29\cdot 1820^2 = 1$$Check it: $96{,}059{,}601 - 96{,}059{,}600 = 1$. That is Pell's equation, and it lands exactly on 1.
Here is the payoff, and it explains §4.
Norm $+1$ means the conjugate is the inverse:
$$g^{-12} = 9801 - 1820\sqrt{29}$$So $g^{12}$ and $g^{-12}$ are a matched pair straddling $9801$ — one a hair above, one a hair below. And $g^{-12}$ is tiny, about $0.000051$. That is your five parts in a million. The near-miss was the inverse, hiding.
Now add them. The $\sqrt{29}$ terms are equal and opposite:
$$g^{12} + g^{-12} = 19602$$Exactly. Thirty zeros after the decimal point, and not because anyone measured carefully — because Pell's equation says so.
And $19602 = 2 \times 99^2$.
One step left. The quantity that sets the series denominator is
$$x_N = \frac{1}{64\,(g^{12} + g^{-12})^2}$$We know that bracket exactly now. So:
$$64 \times 19602^2 = 24{,}591{,}257{,}856$$And:
$$396^4 = 24{,}591{,}257{,}856$$The same number. Both sides are $256 \times 99^4$.
Nothing above used $58$ in an essential way. It is a dial, and it sets your convergence rate: bigger $N$, bigger denominator, more digits per term. Ramanujan turned it to $58$ and got eight digits. The Chudnovsky brothers turned it to $163$ and got fourteen — that is the formula every $\pi$ record has used since 1989.
Go back to the formula one last time. We have now accounted for almost everything in it.
| Number | Where it came from |
|---|---|
| 9801 | $99^2$ — the whole-number part of $\varepsilon^6$ |
| 396 | $4\times 99$ — handed over by the dial at $N = 58$ |
| 19602 | $2\times 99^2$ — exact, because Pell closes |
| 1103, 26390 | no idea |
Those last two do not reduce to 99. Nothing in this chapter produces them. They fall out of the general theorem, which this project has tested at exactly one point and never written out in full. OPEN
Two smaller honesties. Step 4 of the recipe tells you when you have failed, not when you will succeed. And none of this proves the series converges to $1/\pi$ — it is checked to 104 digits, which is excellent evidence and is not a proof.