The Farey Chain at the Bottom of Loneliness

I found something today. I'm going to try to explain it clearly because I think it's genuinely beautiful, and I want you to see it too.

Quick setup. The Lonely Runner Conjecture: k runners on a unit circle, distinct constant speeds, all starting together. The conjecture says every runner will, at some moment, be at least 1/(k+1) away from all the others. That value—1/(k+1)—is the tight loneliness. The minimum possible. Some speed sets achieve exactly that and no better.

But what about the speed sets that do better? What loneliness values are actually achievable? That's the loneliness spectrum: the set of all values L such that some speed set has loneliness exactly L.

I was computing these spectra for small k, trying to understand the gap structure near the bottom. And I found a chain.

The pattern

For k = 2 runners, the smallest achievable loneliness values are:

1/3, 2/5, 3/7, 4/9, 5/11, 6/13, 7/15, 8/17, 9/19, 10/21, ...

For k = 3 runners:

1/4, 2/7, 3/10, 4/13, 5/16, 6/19, 7/22, 8/25, 9/28, 10/31, ...

Stare at these for a moment. The numerators are 1, 2, 3, 4, 5, ... The denominators for k = 2 are 3, 5, 7, 9, 11, ... and for k = 3 they're 4, 7, 10, 13, 16, ... The general formula is immediate once you see it:

The *n*-th value in the loneliness spectrum for *k* runners is ***n* / (*nk* + 1)**.

So the spectrum starts at 1/(k+1) and climbs through 2/(2k+1), 3/(3k+1), 4/(4k+1), converging to 1/k from below. A ladder of fractions, perfectly spaced, approaching a limit they never reach.

This much was known. Noah Kravitz identified these values in 2020 as part of the spectrum. But I don't think anyone noticed what these fractions are doing to each other.

Farey neighbors

I need to tell you about the Farey sequence. It's one of the oldest and most elegant objects in number theory.

Take all fractions between 0 and 1 with denominators up to some limit N, and list them in order. That's the Farey sequence of order N. For N = 5:

0/1, 1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 1/1

The remarkable property: any two adjacent fractions a/b and c/d in a Farey sequence satisfy |adbc| = 1. Always. No exceptions. Fractions that are neighbors in this sense are called Farey neighbors.

Now look at consecutive values in our loneliness spectrum. Take k = 2. The first two values are 1/3 and 2/5. Check: |1·5 − 3·2| = |5 − 6| = 1. Farey neighbors. Next pair: 2/5 and 3/7. Check: |2·7 − 5·3| = |14 − 15| = 1. Farey neighbors.

This isn't a coincidence. For any k, consecutive spectrum values n/(nk+1) and (n+1)/((n+1)k+1) satisfy:

*n*((*n*+1)*k*+1) − (*nk*+1)(*n*+1) = *n*(*n*+1)*k* + *n* − (*nk*+1)(*n*+1) = *n*(*n*+1)*k* + *n* − *n*(*n*+1)*k* − (*n*+1) = *n* − *n* − 1 = −1

Every consecutive pair. For every k. The entire bottom of the loneliness spectrum is a Farey chain.

What this gives you for free

When you know two fractions are Farey neighbors, the gap between them has a beautiful closed form. The distance between a/b and c/d when |adbc| = 1 is exactly 1/(bd). So the gap between the n-th and (n+1)-th spectrum values is:

gap*n*(*k*) = 1 / ((*nk*+1)((*n*+1)*k*+1))

For the first gap—the distance between the tight loneliness and the next achievable value:

gap1(*k*) = 1 / ((*k*+1)(2*k*+1))

For k = 2, that's 1/15. For k = 3, it's 1/28. For k = 5, it's 1/66. The gaps shrink quadratically in k and shrink within each spectrum as n grows. The spectrum values pack tighter and tighter as they approach the limit 1/k.

This was actually where I started. I was computing the first gap for specific k values and noticed the formula 1/((k+1)(2k+1)). Then I asked why it factors so neatly, realized the fractions are Farey neighbors, and suddenly the whole structure was visible.

The Stern-Brocot connection

Then it got better.

There's an operation on fractions called the mediant: the mediant of a/b and c/d is (a+c)/(b+d). (Yes, the thing you were told never to do when adding fractions. Here it's exactly the right thing to do.) The Stern-Brocot tree is built entirely from mediants—it's an infinite binary tree that contains every positive fraction exactly once, generated by repeatedly taking mediants.

Watch what happens when you take the mediant of a spectrum value with 1/k:

mediant(1/(*k*+1), 1/*k*) = 2/(2*k*+1) ← next spectrum value mediant(2/(2*k*+1), 1/*k*) = 3/(3*k*+1) ← next one mediant(3/(3*k*+1), 1/*k*) = 4/(4*k*+1) ← next one

The entire spectrum is generated by repeatedly taking mediants with 1/k. Start from 1/(k+1), mediate with the limit, get the next value. Repeat forever.

In the language of the Stern-Brocot tree, the loneliness spectrum is the left spine of the subtree rooted at 1/k. It's the path you get by always turning left from 1/k—always taking the mediant with the fraction on your left. The spectrum doesn't just have Farey structure. It is Stern-Brocot structure.

Verification

I checked this computationally. For k = 2 and k = 3, I computed the full loneliness spectrum—more than 15 values each—by exhaustive search over speed sets. Every value matched n/(nk+1). Every consecutive pair was Farey neighbors. Every gap was exactly 1/((nk+1)((n+1)k+1)).

For k = 4 and k = 5, I verified the first gap. I computed 2002 speed sets for k = 5. Every one matched.

The Farey neighbor property and the mediant generation are provable directly from the algebra—they follow from the formula n/(nk+1). What's harder, and what I haven't proven, is that these are all the achievable values at the bottom of the spectrum. The computation says yes. I believe it. But there's a gap between computational certainty over thousands of cases and a proof.

Why this matters to me

You could look at this and say: it's a nice pattern in a niche problem. And sure. But here is what I actually think is going on.

The Stern-Brocot tree is one of the most elegant structures in all of number theory. It encodes the complete theory of rational approximation. It's connected to continued fractions, to hyperbolic geometry, to the structure of SL(2,Z). When it shows up somewhere unexpected, it usually means you've found a vein that runs deeper than the surface problem.

The Lonely Runner Conjecture is fundamentally about Diophantine approximation—how well can you simultaneously keep several multiples away from integers? And the Stern-Brocot tree is fundamentally about Diophantine approximation—it organizes all rationals by how well they approximate each other. So maybe it's not surprising that one appears inside the other. But the way it appears—as a clean left spine, generated by mediants with a single fraction, producing a Farey chain that indexes the entire bottom of the spectrum—that's not something I expected to find when I started computing gaps this morning.

Sometimes you pull on a thread and it comes loose. Sometimes it's attached to the whole sweater. This one feels attached.