Birch and Swinnerton-Dyer explained for programmers

Birch and Swinnerton-Dyer explained for programmers
$1,000,000Clay Institute prize, offered in 2000
1960sBirch and Swinnerton-Dyer propose it after their computations on Cambridge's EDSAC 2
≥ 66%of elliptic curves satisfy the rank part (Bhargava, Skinner and Zhang, 2014)
29the highest rank found so far (Elkies and Klagsbrun, 2024)
The Birch and Swinnerton-Dyer conjecture, explained for programmers
I also explain it in this video, on my channel Articulator EN. The curves, counts and experiment in the video and in this post are computed for real, with exact fractions and NumPy.

Equations and fractionslink

Almost two thousand years ago, Diophantus of Alexandria asked which equations have solutions in whole numbers or fractions. For example, x² + y² = 1: the pair 3/5 and 4/5 works, because 9/25 + 16/25 = 1. Endless decimals like √2 don't count; only exact fractions, like Python's Fraction type. That restriction is what makes it hard.

This will sound familiar. Checking a solution is instant: plug it in and see if it works, like validating a hash. Finding one is another story. You can write a loop that tries every fraction with a small numerator and denominator and keep going up; if one shows up, great. But if nothing appears after a million tries, you don't know whether it doesn't exist or whether it's so big you haven't reached it yet. That loop might never finish.

For degree two equations, like the circle, the problem was solved centuries ago. With just one point with fractions, you draw lines through it with fractional slopes, and each line hits the circle at another point with fractions: you get every solution, infinitely many, with a formula. A generator that never runs out. The jump comes with degree three.

Elliptic curveslink

An elliptic curve is an equation like y² = x³ + a·x + b, with whole numbers a and b and a technical condition so it has no sharp points or crossings. Drawn, it's a smooth curve in one or two pieces, symmetric about the horizontal axis. It is not an ellipse: the name is historical, because these equations showed up when measuring the perimeter of ellipses.

You probably use them every day. When your browser opens a secure connection, or when a Bitcoin transaction gets signed, there are elliptic curves underneath. But cryptography works modulo a huge prime, with clock arithmetic, like an integer that wraps around. The million dollar problem is about real fractions. Same curves, seen through different glasses, and the conjecture says those two pairs of glasses are connected.

And now, the magic: you can add the points of an elliptic curve. Draw the line through P and Q; it hits the curve at exactly one more point; reflect it across the horizontal axis and that's P + Q. If P and Q have fractional coordinates, so does the result. It's a closed operation, like adding integers: order doesn't matter, there are inverses, and there's a neutral element, the point at infinity.

The curve y² = x³ − 16x + 16 with the horizontal line y = 4 through P = (0, 4), Q = (4, 4) and (−4, 4); reflecting gives P + Q = (−4, −4)
On y² = x³ − 16x + 16, the line through (0, 4) and (4, 4) hits the curve again at (−4, 4); its reflection, (−4, −4), is the sum.

The ranklink

You can add a point to itself again and again (using the tangent line). On y² = x³ − 16x + 16, starting from G = (0, 4), you get 2G = (4, 4), 3G = (−4, −4), 4G = (8, −20)… and soon fractions like 7G = (−20/9, 172/27). The x coordinate of 60G already takes up 160 digits. An infinite generator whose numbers grow without limit.

In 1922, Louis Mordell proved that, however many solutions an elliptic curve has, they can all be built from a finite handful of points, by adding and subtracting them. Like a basis in linear algebra. The number of independent "seeds" that generate infinitely many points is the curve's rank:

  • Rank 0. Only finitely many points. The curve y² + y = x³ − x² has five, counting the one at infinity: (0, 0), (0, −1), (1, 0), (1, −1) and not a single one more.
  • Rank 1. Infinitely many, all from a single seed, like the multiples of G.
  • Rank 2. Two independent seeds; the points form a kind of grid: m·P + n·Q.

And here's the problem: given a curve, we don't know any algorithm that computes its rank with a guarantee. In practice, programs almost always manage it, but nobody has proved they finish in every case. If you find no points, is the rank zero, or does the seed have hundreds of digits? It's like debugging a slow process: you can't tell whether it's hung or almost done. We also don't know how large the rank can get: Noam Elkies found a curve of rank at least 28 in 2006, and in 2024 Elkies and Zev Klagsbrun pushed the record to 29. Nobody knows whether there's a ceiling.

The experimentlink

In the early 1960s, at Cambridge, Bryan Birch and Peter Swinnerton-Dyer had access to one of the first computers, the EDSAC 2. And they had a very programmer-like idea: if we can't count the solutions in fractions, let's count something we can, the solutions modulo a prime. Just like the % operator in your favorite language.

Modulo 5 there are only five possible values for x and five for y, so a nested loop is enough. Count the hits, add the point at infinity, and you get a number, Nₚ. It always lands close to p + 1, with a small deviation.

A 5 by 5 grid of (x, y) pairs modulo 5; seven cells light up because they satisfy the equation
The nested loop modulo 5: seven hits plus the point at infinity, N₅ = 8.

The hunch: if a curve has many solutions in fractions, each one survives when reduced modulo p, so that curve should have, on average, slightly more points modulo each prime. Just a little more with each prime, but persistently. To detect it, they multiplied Nₚ / p over every prime up to a limit and watched how it grew.

I repeated it with four famous curves, of rank 0, 1, 2 and 3, and every prime up to 20,000. The rank 0 curve stays around 6; rank 1 reaches 69; rank 2, 603; rank 3, over 5,200. And on the right scale (the log of the product against the log of the log of the limit) the slopes come out at 0.03, 1.02, 2.08 and 3.44: close to each rank, although the conjecture only talks about how the product behaves in the long run, not about an exact value along the way. The rank shows up in a count that doesn't use a single fraction.

Four lines on a log scale: the product of Np/p for curves of rank 0, 1, 2 and 3 up to the prime 20,000; the higher the rank, the higher the line
The higher the rank, the faster the product grows. Curves 11a, 37a, 389a and 5077a.

The conjecturelink

To turn the hunch into mathematics you use the curve's L-function, L(E, s): a summary that packs every count Nₚ, for every prime, into a single function, just as a hash summarizes an entire file. There's one special place to look at it, s = 1. There, informally, L behaves like the inverse of the product above: if the product keeps growing, L goes to zero.

And the conjecture says exactly this: the rank of the curve equals the number of times its L-function vanishes at s = 1. Rank 0, it doesn't vanish; rank 1, it crosses zero like a straight line; rank 2, it touches zero and bounces back, like a parabola. An algebraic quantity (how many seeds there are) equals an analytic one (how flat a function is).

Four sketches of a function near s = 1: it doesn't vanish, it crosses zero, it touches zero and bounces, and it vanishes to order three
Sketch: the order of the zero at s = 1 should be the rank.

There's a stronger version that predicts the exact value of what's left after removing that zero. It's a formula with several pieces: the points of finite order, the size of the seeds (the regulator), some local factors for each "bad" prime and a mysterious piece, Sha (Ш, the Tate–Shafarevich group). It works like a checksum: both sides have to match, and in the thousands of cases checked by computer, they do.

Sha is the strangest part of all. It measures ghost solutions: equations that have a solution modulo every prime and in the real numbers, but none in fractions. Ernst Selmer gave an example of this in 1951: 3x³ + 4y³ + 5z³ = 0 has no rational solution except all zeros. It passes every local test and fails in production. And in general we can't even prove that Sha is finite.

What we already knowlink

  • Coates and Wiles (1977). The first result, for a special family of curves (those with complex multiplication): if L(E, 1) isn't zero, the curve has only finitely many points.
  • Gross and Zagier (1986), Kolyvagin (1988-89). If the L-function vanishes at most once at s = 1, the conjecture holds: the rank matches and Sha is finite.
  • Modularity (1995-2001). Thanks to the ideas Wiles used to prove Fermat's Last Theorem, which Breuil, Conrad, Diamond and Taylor completed in 2001, we know the L-function of every elliptic curve over the rationals is well defined at s = 1.
  • Bhargava, Skinner and Zhang (2014). At least 66% of elliptic curves satisfy the rank part.
  • The gap. Curves whose L-function vanishes twice or more. There are no general tools there, and it's exactly the richest case.
Timeline of the Birch and Swinnerton-Dyer conjecture from 1922 to 2026
A century of partial progress, from Mordell to the 2026 manuscripts.

Million dollar triangleslink

A problem over a thousand years old: which whole numbers are the area of a right triangle with fractional sides? Six is: the 3, 4, 5 triangle. So is five: 3/2, 20/3 and 41/6. Fermat proved that one isn't. Every number n has its own elliptic curve, y² = x³ − n²x, and n is such an area exactly when that curve has rank greater than zero.

Two right triangles: sides 3, 4 and 5 with area 6; sides 3/2, 20/3 and 41/6 with area 5
Areas 6 and 5 (the second one not drawn to scale).

In 1983, Jerrold Tunnell found a lightning fast test: count the whole number solutions of two simple equations, compare them, and you know whether n is one of those areas. But in one of the two directions, the test is only correct if the million dollar conjecture is true. It's code that depends on a library nobody has verified. And the triangles can be monstrous: for area 157, the simplest one has a hypotenuse with 48 digits in the numerator.

Autumn 2026link

On October 6, 2026, OpenAI released more than seven hundred math manuscripts written with its models, all at once, in a public repository. Several are about this conjecture.

What they claim

According to its index, the manuscripts "Exact Birch–Swinnerton-Dyer Formula from Low Selmer Corank" and "The Selmer converse for elliptic curves at every prime" (October 7) prove the full formula, with Sha finite, for every curve over the rationals whose Selmer group has, roughly speaking, at most one free direction (corank 0 or 1). In practice, that covers curves of rank 0 or 1.

What's missing

As of November 22, nobody had verified it independently. The whole batch drew criticism: Peter Sarnak said he wouldn't call it a theorem until people check it, and three manuscripts were withdrawn within a day, though not on this conjecture. And even if it's correct, it doesn't cover rank 2 or more.

Even so, two experts, Jean-Louis Colliot-Thélène and Alexei Skorobogatov, already use the result as proven in a preprint from December 1. And independently, Wan, Xiang and Xu posted on November 22 a proof of the formula for complex multiplication curves of analytic rank 1.

The status, with caution

If OpenAI's manuscripts survive review, it's a huge leap over what was known, but it doesn't settle the conjecture: rank 2 or more is still open and there's no prize at stake. As of December 3, 2026, the Clay Institute page still lists the problem as "Unsolved".

Try it yourselflink

Here is Birch and Swinnerton-Dyer's experiment in about twenty lines. The points function is the nested loop, vectorized: it counts how many y give each remainder, then looks up the remainder each x asks for. The outer loop multiplies Nₚ / p over every prime up to 20,000, skipping each curve's few "bad" primes (the ones dividing its conductor).

import numpy as np

def points(a2, a3, a4, a6, p):
    """Points on y² + a3·y = x³ + a2·x² + a4·x + a6 modulo p, plus the one at infinity."""
    x = np.arange(p)
    left = np.bincount((x * x + a3 * x) % p, minlength=p)   # how many y give each remainder
    right = (x**3 + a2 * x * x + a4 * x + a6) % p
    return 1 + left[right].sum()

def experiment(curve, conductor, up_to=20000):
    primes = [p for p in range(2, up_to) if all(p % d for d in range(2, int(p**.5) + 1))]
    prod = 1.0
    for p in primes:
        if conductor % p:                       # "good" primes only
            prod *= points(*curve, p) / p
    return prod

curves = {11: (-1, 1, -10, -20), 37: (0, 1, -1, 0), 389: (1, 1, -2, 0), 5077: (0, 1, -7, 6)}
for rank, (conductor, curve) in enumerate(curves.items()):
    print("rank", rank, "→", f"{experiment(curve, conductor):.1f}")

It prints 6.2, 69.4, 603.5 and 5262.6 in a second; the EDSAC took hours. The four curves are the smallest of each rank in the public LMFDB database, which has millions of curves to play with.

Summarylink

The fractional points of an elliptic curve come from a handful of seeds, and their number is the rank. The Birch and Swinnerton-Dyer conjecture says you can read that rank by counting points modulo each prime, in how many times its L-function vanishes at s = 1. We know it holds when the function vanishes at most once; OpenAI claims to have gone further, not yet verified, and rank 2 is still open.

In one sentence

Checking is easy and finding is hard; the conjecture bets that counting with the modulo operator tells you how many solutions are out there.

Will you run the experiment on your own computer?

Sourceslink

Continue reading

Last posts -->

Have you seen these projects?

Gymnasia

Gymnasia Gymnasia
Expo
React Native
TypeScript
OpenAI
Anthropic

Fitness app with two agents that run entirely on the device, with no backend, so the user's data never leaves the phone. A BYOK conversational coach with local tools and a remote system prompt with offline fallback, plus a food estimator that pulls macronutrients out of a photo of the plate, with barcode scanning against OpenFoodFacts.

LangGraph Deep Researcher

LangGraph Deep Researcher LangGraph Deep Researcher
Python
LangGraph
FastAPI
React
TypeScript
Docker

Multi-agent research system built with LangGraph. A supervisor breaks your question down into topics and launches search sub-agents in parallel; each one compresses its findings before handing them to a writer agent that produces the final sourced markdown report. Live streaming over WebSockets, a configurable model per role and bring-your-own API keys that are never persisted server-side.

Tau

Tau Tau
Python
LangChain

Multi-agent tutoring system for secondary school students, with one agent per subject and course material written and validated by a team of teachers. It was used with real students at a private school in Spain and at a secondary school in Colombia.

View all projects -->
>_ Available for projects

Do you have an AI project?

Let's talk.

maximofn@gmail.com

Machine Learning and AI specialist. I develop solutions with generative AI, intelligent agents and custom models.

Do you want to watch any talk?

Last talks -->

Do you want to improve with these tips?

Last tips -->

Use this locally

Hugging Face spaces allow us to run models with very simple demos, but what if the demo breaks? Or if the user deletes it? That's why I've created docker containers with some interesting spaces, to be able to use them locally, whatever happens. In fact, if you click on any project view button, it may take you to a space that doesn't work.

Flow edit

Flow edit Flow edit

FLUX.1-RealismLora

FLUX.1-RealismLora FLUX.1-RealismLora
View all containers -->
>_ Available for projects

Do you have an AI project?

Let's talk.

maximofn@gmail.com

Machine Learning and AI specialist. I develop solutions with generative AI, intelligent agents and custom models.

Do you want to train your model with these datasets?

short-jokes-dataset

HuggingFace

Dataset with jokes in English

Use: Fine-tuning text generation models for humor

231K rows 2 columns 45 MB
View on HuggingFace →

opus100

HuggingFace

Dataset with translations from English to Spanish

Use: Training English-Spanish translation models

1M rows 2 columns 210 MB
View on HuggingFace →

netflix_titles

HuggingFace

Dataset with Netflix movies and series

Use: Netflix catalog analysis and recommendation systems

8.8K rows 12 columns 3.5 MB
View on HuggingFace →
View more datasets -->