Counting the spirals
Worth reading first: A head is a set of points.
Look at a sunflower and spirals appear. Follow one with a finger and it curves out to the rim; follow one going the other way and it does the same. Count them and the numbers are usually 34 and 55, or 55 and 89, or some other pair of consecutive Fibonacci numbers.
That is the observation the whole subject rests on, and it is worth asking what exactly is being counted.
What a spiral is, in a pattern made of points
A spiral in a seed head is not a curve. It is a chain of near-neighbours.
Take the point born 34 places before any given point. In a golden-angle head it sits very close by — much closer than a point 20 or 45 places earlier. Join every point to the one 34 places before it and the result is a set of 34 chains, each winding out from the centre. Those are the spirals a person traces.
So a spiral family is labelled by an offset: the number of places back in birth order that lands one on a near neighbour. The parastichy numbers of a pattern are the offsets that do this, and everything about counting spirals is about finding them.
That reframing is what makes counting a computation rather than an impression. A curve fitted to a photograph is a matter of judgement; the question of which index offset gives the shortest hop is not.
The counter, and what it is not told
The arrangement matters more than the algorithm, so it is worth being explicit.
One function builds a head from a divergence angle. A different function is handed an array of coordinates and asked which offsets give short hops. It does not receive the angle. It does not receive the model. It does not know that Fibonacci numbers are the expected answer, and it would return 47 and 76 just as readily.
The method: for each candidate offset m, measure the distance from every point to the point m places before it, take the median, and divide by the local spacing so the answer does not depend on scale. Plot that against m and the parastichy numbers appear as local minima — offsets that give hops much shorter than their neighbours do.
Requiring a local minimum rather than simply a short hop is the part that does the work. Offset 1 always gives a shortish hop; so does offset 2. Without the local-minimum requirement the counter would report 1 and 2 for every pattern ever made, which is true and useless.
The bug that only a second route could find
The first version of this counter returned the two smallest offsets among the minima rather than the two shortest.
For a golden-angle head that means it reported 21 and 34, when the offsets that actually give the closest neighbours at that radius are 34 and 55. Both are genuine parastichy families — 21 is a real spiral family in that head — so the drawing looked entirely correct. Twenty-one spirals were drawn and there were twenty-one of them.
Nothing in the figure showed the error. What showed it was the angle recovery, which takes a pair of counts and asks which divergence angle makes those two offsets the closest. Fed 21 and 34 at that radius it refused: no angle does. The refusal was correct, and it was the only thing in the system that could tell the difference.
That is the argument for the second route in one paragraph. A count that is merely plausible cannot be distinguished from a count that is right by looking at the picture the count produced.
It is worth naming what made this bug findable at all, since most are not. The two offsets were both real families, so no drawing could contradict them; what contradicted them was a second instrument with its own refusal, asking a question the first one does not — not is this a family but can these two be the closest two at once. A checker that only ever agrees adds nothing; one that can decline is the only kind that catches a plausible answer.
Showing that the counter rejects
An assertion that has never failed on anything is not a test, and on this subject that matters more than usual: a counter that always returned Fibonacci numbers would confirm every claim ever made about sunflowers.
So it is run on a lattice built at 45°, which is a rational angle and produces eight radial rows and no spirals at all. The counter returns 8 and 16 — the row count and its double — and not a Fibonacci pair anywhere.
That single check is what makes every other count on this site worth reading. Without it, “the counter found 34 and 55” is a statement about the counter.
Why the answer depends on where one look
The counter takes a radius band as well as a point set, and it has to, because the answer genuinely depends on it.
Near the centre of a head the points are sparse and the short offsets win: 13 and 21, or 21 and 34. Further out, the same head gives 34 and 55, then 55 and 89. The transitions happen at radii that can be computed, and they are the subject of the next essay.
This is not a defect of the method. It is the pattern being honest about itself: a spiral lattice does not have a parastichy pair, it has a parastichy pair at a radius. Every published count of a sunflower is a count in whichever annulus the counter happened to work in, and the practice of quoting one pair per flower obscures a real and computable structure.
Ambiguity at the transitions
Between one regime and the next there is a band where three offsets have almost the same hop length, and there the count is genuinely ambiguous.
At one radius in the head measured here, offset 55 gives a hop of 1.68 in units of the mean spacing, offset 34 gives 2.01, and offset 89 gives 2.10. Which pair the eye picks out — or the counter — depends on details that carry no information.
That ambiguity forced a change in the machinery. The angle recovery originally required the observed pair to be the two shortest offsets; near a transition it refused patterns it had counted correctly. It now asks for both to be among the shortest three, and reports a wider interval when the constraint is looser. The tolerance is not a fudge — it is the ambiguity of the pattern, made explicit.
What the counting does not settle
Two things, and both are usually assumed.
It does not say the counts are Fibonacci. It says what they are. That they usually come out Fibonacci in a golden-angle head is a consequence of the angle, and heads built at other angles give other sequences — Lucas numbers, or nothing named at all.
It does not say anything about real flowers. Everything here is measured on generated patterns, where the truth is available. That is deliberate: the site’s job is to establish what a count means and what it can be trusted to reveal, and a photograph would add authority the argument has not earned. What the counting establishes is that the operation is well defined and testable, which is the precondition for anyone doing it on real material and being believed.
The general shape of it
The pattern this essay repeats is the one this whole collection is built on, and it is worth naming.
An observation that is usually made by eye — there are 34 spirals — is restated as a computable quantity: offset 34 gives a local minimum of the median hop length in this annulus. The restatement is more work, it is less evocative, and it is the difference between a claim that can be checked and one that can only be repeated.
Then the computation is shown to reject, on input where the right answer is known to be different. Then it is checked against a second, independently-shaped computation that could disagree. Only after all three does a number get quoted in a caption.
What counting is worth
The operation is unglamorous and it is what everything else on this site is built on.
The angle can be recovered because the counts carry it. The transitions across a head are visible because the count can be repeated at different radii. The Fibonacci claim can be tested because other angles can be counted too, and their counts are not Fibonacci.
None of that is available to a reader who takes the count from a caption.
Why a median and not a mean
A small implementation choice with a real consequence.
For each candidate offset the counter takes the median hop length over all points, not the mean. The reason is the head’s boundary: points near the rim have no predecessor at some offsets, and points near the centre have hops distorted by the √i radius law compressing everything.
A mean is dragged around by those tails. A median is not, and the local minima that identify the parastichy numbers stay sharp. Switching to a mean does not break the counter outright — it broadens the minima until adjacent offsets become hard to separate, which is the sort of degradation that looks like the data being noisy rather than the statistic being wrong.
The hop lengths are also divided by the local spacing, so the result is dimensionless. Without that the answer would depend on the model’s scale and on the number of points, and comparing two heads would mean comparing two arbitrary units.
What the minima look like
The profile of median hop length against offset is the counter’s actual output, and reading it is more informative than reading the two numbers it reduces to.
Most offsets give a hop of roughly the mean spacing times √m — a random pair of points m places apart is nowhere in particular. Against that background the parastichy offsets appear as deep, narrow minima, often at half the surrounding level or less.
The minima come in a sequence: 1, 2, 3, 5, 8, 13, 21, 34, 55 for a golden-angle head, getting shallower as m grows. Only the two deepest at a given radius are the parastichy numbers people count; the rest are the offsets that used to be, at smaller radii, or that will be further out.
So the profile contains the whole radius story in one plot, and the pair of numbers everyone quotes is a reading of it at one radius. That is a good argument for showing the profile rather than the pair.
What the counter would say about a bad pattern
Running the counter on inputs it should fail on is how one learns whether it measures anything, and there are three such inputs in the checks.
A rational angle. At exactly 120°, points fall on three radial rays. The counter finds the offsets that traverse a ray — 3, 6, 9 — rather than a Fibonacci pair, which is correct and is the answer nobody expects. If it returned 34 and 55 there it would be returning them from somewhere other than the data.
Random points. No offset gives a systematically short hop, so the profile is flat and the counter has no deep minima to report. That is the null case, and a counter that finds spirals in noise finds them everywhere.
A jittered head. Add noise to a golden-angle head and the minima broaden and then vanish, at a noise level that can be measured. That number — how much positional error the counting survives — is the honest answer to “how reliable is a count from a photograph”, and it is not small.
What is not being claimed
The counter finds which index offsets give short hops. It does not find spirals in any perceptual sense, and the distinction has a consequence.
A person tracing a curve on a photograph is following a visual continuity, and what they follow depends on seed size, contrast and how the head was cut. The counter is answering a question about birth order, which a photograph does not show at all: the index of a seed is not visible, and the correspondence between “the point 34 places earlier” and “the next seed along that curve” is an inference from the model.
For a generated head that inference is exact, because the model supplies the order. For a real head it is very good and not exact, since primordia are not laid down in a perfectly regular sequence and later growth displaces them.
So the honest chain is: the counter measures offsets, offsets correspond to visible spiral families under the model, and the model is independently supported. Each link is checkable and the middle one is the one usually left implicit.
What the count is for
Counting is the first step of everything else on this site, so it is worth saying what the number feeds into.
It feeds the angle recovery, which turns a pair of counts and a radius into a divergence angle — the quantity the models are actually about.
It feeds the comparison across branches, since the sequence a head produces is how one tells which branch it is on without measuring an angle directly.
And it feeds the radius story, which is only statable because the counting can be done independently in separate bands.
A count on its own — quoted in a caption with no radius and no head size — feeds none of them, which is the practical case for treating counting as a measurement rather than an observation.
The arrangement, once more
The separation between generating and counting is worth restating at the end, because everything downstream depends on it and it is the kind of thing that erodes.
place() takes an angle and returns coordinates. parastichy() takes coordinates and
returns offsets. They share no state, no constants and no expectations, and the second
has never been shown the first’s input.
That is why a count of 34 on this site is evidence rather than a restatement, and it is why the angle recovered from the counts agreeing with the angle the head was built at means something.
The erosion to watch for is a convenience: passing the angle into the counter to speed it up, or seeding the offset search with the Fibonacci numbers because they are the expected answer. Either would make every figure faster and every result circular, and neither would change a single drawn picture — which is exactly why the arrangement is written down here rather than left as a property of the code.
The same counter on a stem, and the rule that had to go
Expansion pointed this machinery at a cylinder, and one line of it turned out to be wrong there — which is a useful demonstration that the local-minimum requirement is a decision about the geometry rather than a general truth about counting.
On a disc the requirement is essential. Offset 1 always gives a shortish hop, so a counter taking the two shortest without qualification would answer “1 and 2” for every pattern ever built.
On a cylinder, offset 1 disqualifies itself: a hop of one node is at least one rise tall, whatever the divergence. So the two shortest hops are the parastichy numbers, and imposing a local minimum actively broke the count — at a rise of 0.09 the offsets 2 and 3 are shortest by a clear margin, but 3 is not a local minimum, so the counter skipped to 5 and reported a pattern with no lattice consistent with it.
The lesson is the one this essay already carries in another form. The counter’s rules encode assumptions about the geometry it is counting on, and moving it to a new geometry moves those assumptions with it — silently, because a wrong count still draws a correct-looking picture.
Once again the error was caught downstream, by a recovery that refused.
What links here
Computed from the collection, not written here: the essays that point at this one.
Reads more easily once this is understood
Essays that name this one as worth reading first.
- A band that holds the angle still
- A band that moves nothing
- A count with a factor in it
- A counter that sees no positions
- A cut of two organs
- A dip with no outer edge
- A file has to close
- A front with no middle
- A harmonic is a step taken twice
- A period that is not a count
- A period the grid invented
- A periodicity is not a lattice
- A stem coarse enough to cut
- A stem too fine to settle
- A step of one organ
- A survivor has to be a neighbour
- A wall and not a budget
- A wreck has a short list
- Both walls of the slot
- Counting up the stem
- Counting without an index
- Every family but two is a sum
- Four crossings nobody visited
- How long a stem takes to settle
- How wide a band should be
- Not the shorter of the two
- One offset, two answers
- One rise per rung is a sample
- One rung, two answers
- One turn per survivor
- Recovering the angle from the counts
- Removing a neighbour costs least
- Seven rises and two seeds
- The ablation a plant would survive
- The angle the ladder returns to
- The angles name the branch
- The band was not the sampling
- The block is the count it was cut from
- The column that cost no stems
- The corner moves with the rise
- The counts change with radius
- The damage has a period
- The family that lost a member
- The Fibonacci ladder
- The front deepens down a rung
- The hop that survived
- The organ that moved furthest
- The organ that was nobody's neighbour
- The pair read from the angles
- The panel with no corner
- The response with a hole in it
- The second comb
- The shallower front turns over
- The share was not the thing
- The shortest hop was a coin flip
- The six are the spirals
- The slide a counter holds constant
- The stem that changed hands
- The symmetry that is not there
- Three organs and no mirror
- Two accounts of one number
- Two at a time
- Two lines that cross once
- Two rungs, one angle
- What a count cannot decide
- What a count is worth
- What a cut costs a whorl
- Where a handover sits
- Where the survivors meet
- Which chains changed places
- Four accounts of one angle
- A fifth of the hop
- Twice the run
- A counter on the settling table
- What a steep rule counts as
- Ten sequences, two of them the ladder's
- Every rise of a band
- The alternation is not a period
- Three offsets, three crossings
- A list that was a rounding
- One way round, seventeen times
- The second band, cut whole
- The wrecking set moves again
- The lag that never survives
- One rise below the census
- The offsets that never change
- A stem on the other branch
- Two rankings, one list
- Half a turn, four at a time
- How many organs a pair needs
- A wrecking set with a range
- A plateau the instrument should have had
- A sequence that was a reading
- Fibonacci is a branch, not a law
- A counter that cannot be slid
- The window nobody varied
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- The organ that guards the second slot — both name divergence angle, lattice offset, nearest neighbour, rise, transitions
- The ratio was the floor of a curve — both name discrimination, divergence angle, nearest neighbour, rise, transitions
- Where a handover sits — both name divergence angle, nearest neighbour, parastichy, rise, transitions
- A cone has a rise that falls — both name divergence angle, parastichy, rise, transitions
- A pattern with a rate — both name branch, noise, rise, transitions
- A periodicity is not a lattice — both name discrimination, divergence angle, lattice offset, noise
Named objects
A flat tag is an object no other essay names yet.
BranchDiscriminationDivergence angleFibonacciLattice offsetLocal minimumNearest neighbourNoiseParastichyRiseTransitions