The best angle is the worst number
A growing head of seeds has one decision to make and makes it once: turn by some fixed angle, put down a seed, repeat. Almost every angle wastes the head — the seeds fall into a few spokes and leave the space between them empty. The angle that never runs out of room is not a nice one. It is the number that fractions approximate worst, and the two statements are the same statement. Turn the dial and watch every good fraction ruin the packing.
The head
Why it fails: one turn of the circle
Forget the radius. Every seed's angle, folded onto a single turn. The packing is only as good as the worst hole left here, and the holes are not arbitrary — Steinhaus proved in the 1950s that however many points you drop this way, the gaps between them take at most three lengths, and the longest is always exactly the other two added together. Measured live below, on whatever the dial is set to.
The fraction it is nearest
Every hole in the head is a fraction the angle is close to. The continued fraction lists them in order of how good a bargain they are, and the last column is the whole story: q ‖qα‖, how much accuracy the fraction buys per unit of denominator. Small means a good fraction, and a good fraction means a ruined head.
Every angle at once
The dial, swept. Above: how far apart the closest two seeds end up — the packing, higher is better. Below: the same angles' worst-case bargain for fractions, higher is harder to approximate. They are the same curve, which is the claim this page exists to make.
How close a fraction is allowed to get
Hurwitz, 1891: every irrational number has infinitely many fractions closer than 1/(√5 q²), and √5 cannot be made larger. Each dot is a convergent. Note what the theorem does not say: the golden angle's dots go under the floor too, and must. What is special about it is that they come back — its line converges onto the floor, while √2 − 1 drops to a second, lower line and stays there. That second line is the next rung of the ladder in the panel below.
The ladder below √5
Take √5 away and there is a next-worst number, and a next. The ladder is discrete, it is indexed by the whole-number solutions of x²+y²+z² = 3xyz, and it was found by Markov in 1879. The page builds the solutions, builds each one's number out of nothing but 1s and 2s, measures how badly fractions approximate it, and compares that with Markov's formula — which nothing else on this page knows about.
Checks
The same fact, said twice
Put a seed down every α turns. After q seeds the head has turned qα, and if that is close to a whole number of turns the qth seed lands almost on top of the first. So it is not that a rational angle is bad and an irrational one is fine — an irrational angle that is near a fraction with a small denominator is bad in exactly the same way, and only for a while less so. The quantity that decides is the distance from qα to the nearest whole number, and the only angles that pack well are the ones for which that distance stays stubbornly large for every q, forever.
That is already a question about approximating numbers by fractions, and it has a sharp answer. The distance can never stay too large: Hurwitz says some fraction always beats 1/(√5 q²), infinitely often, for every irrational there is — the golden ratio not excepted, and it is worth being careful about that, because the tempting summary that φ alone never goes under the bound is simply false. What is true is finer: for φ the bound is the exact limit the good fractions approach, so the amount by which they beat it dies away to nothing, while for every other number a whole family of fractions stays a fixed distance better than it forever. And the number that makes you work hardest — the one where √5 cannot be raised at all — is the golden ratio, whose continued fraction is all ones, which is to say the fraction that never gets a good bargain because a good bargain is a large partial quotient and there are none. The sunflower is not doing number theory. It is just that there is only one place to stand.
Three lengths, never four
The middle panel is the mechanism, and it is a theorem worth knowing on its own. Drop N points on a circle at every multiple of any angle you like, and measure the N gaps they leave. However large N is and whatever the angle, you will find at most three different lengths among them, and if there are three, the biggest is the sum of the other two. Not approximately — exactly, every time. So a head of seeds cannot be locally uneven in any complicated way; it has one hole size, or two, or two and their sum, and the packing question is entirely the question of how big the largest of them is allowed to be.
The smallest of the three is the part that touches this page's other panels. It is always ‖qα‖ for one particular q below N — the denominator of the best fraction the angle has been offered so far. Every time N grows past a new convergent, the smallest gap drops to the new one and the head grows a new set of spirals. The spiral arms you can count in the first panel are denominators of continued-fraction convergents, which is why sunflowers are counted in Fibonacci numbers and not in anything else.
What is checked against what
A page that measures a thing and then grades its own measurement is grading its homework, so the arithmetic here is held to three things it does not derive. The first is Steinhaus: the gaps are found by sorting the points and subtracting, with no theory anywhere near them, and then the three-length property is tested rather than assumed — it is a claim the measurement could contradict on any position of the dial, and the checks panel keeps count. The second is Hurwitz's constant, which is a floor the measured convergents are compared against and never cross. The third is Markov's equation, from 1879: the page generates its whole-number solutions, turns each into a number by a route that involves no square roots at all — a periodic pattern of 1s and 2s, folded into a continued fraction — measures how badly fractions approximate it, and only then compares the result with √(9m²−4)/m. Those two have no business agreeing to twelve digits unless both are right.
Where it stops being true
Two honest limits. The head here is the ideal one, seed n at radius √n exactly, which keeps the area per seed constant and is a model rather than a plant; a real head grows from a meristem with a finite bud and its early seeds are not on this spiral. And every number on the dial is a double, so an angle is only ever a fraction with a denominator around 2⁵³ — the page cannot really tell an irrational from a very good rational, and at large enough N every angle it can hold eventually reveals itself as rational and the packing collapses. The sweep stays well short of that, and the checks panel measures where it would start.
Second opinion in
tests/test_seeds.py, which redoes the
continued fractions in exact integer arithmetic and finds the best
fractions by exhaustive search. Entry 0010.