Generator

The Stern–Brocot tree to depth 4

A generator in the number library, called 52 times across 11 essays. Below: what it draws with nothing chosen and at each mode an essay asks for, what it checks while drawing, and everywhere it is used.

mediant is one function. Everything below came out of it during this build, at parameters taken from the essays rather than invented for this page — so a figure here is the same figure a reader meets in an essay, and if the generator changes, this page changes with it.

With nothing chosen

The Stern–Brocot tree to depth 4. Every positive rational, each appearing exactly once, generated by taking mediants.

Every denominator has a fraction with small quotients

Every denominator has a fraction with small quotients. 2:1340 3:1624 4:32 5:3; need 5: 6,54,150

The denominators each bound misses

The denominators each bound misses. A=2: 52950 fails; A=3: 38 fails (6,20,28,38,42,54,90,96,150,156,164,216,228,252,318,336,350,384,386,442,508,558,770,876,922,978,1014,1155,1170,1410,1450,1692,1870,2052,2370,3618,5052,6234); A=4: 3 fails (6,54,150); A=5: 0 fails ()

The surplus of fractions over denominators

The surplus of fractions over denominators. A=2: 1.0720 vs 1.0626; A=3: 1.4115 vs 1.4113; A=4: 1.5778 vs 1.5779; A=5: 1.6737 vs 1.6737

Thousands of good fractions for a typical denominator

Thousands of good fractions for a typical denominator. slope 0.6188; predicted 0.6737; min count for q > 1000: 29.

Rarer at every size, and never absent

Rarer at every size, and never absent. 11:8.000e-1, 97:3.542e-1, 211:2.286e-1, 383:1.806e-1, 643:1.589e-1, 1031:1.437e-1, 1607:1.196e-1, 2467:1.071e-1, 3761:9.096e-2, 5647:7.598e-2, 8501:7.271e-2, 12697:6.081e-2, 18979:5.680e-2, 28349:4.734e-2, 42239:4.484e-2, 62969:3.770e-2, 93809:3.395e-2

What it checks while it draws

Collected by running the family and recording what it asserted, not written here. The count is how many separate times the claim was put to the test while these drawings were made.

Where it is called

Every figure on this list is drawn by the same rule, so a change to the rule changes all of them at once. That is why the list is published.

Number

A small quotient for every denominator

Pick a denominator, any whole number. Among the fractions with that denominator, is there always one whose continued fraction has no large entries — whose path down the Stern–Brocot tree never turns the same way more than five times running? Stanisław Zaremba guessed so in 1972, for a reason to do with sampling a square evenly. Every denominator up to a hundred thousand obeys, with only 6, 54 and 150 needing a five. The guess is proved for almost every denominator and not for all, and the reason it ought to be true is a dimension: the reals whose quotients stay at most five fill a set of dimension 0.837, enough to give each denominator thousands of good fractions on average, and the open question is whether averages are kept everywhere.

Number

A tree that holds every triple

Three fixed matrices, applied to 3-4-5 over and over, produce every primitive Pythagorean triple there is — each of them once, none of them twice, and with no test for common factors anywhere in the procedure.

Number

Approached too fast to be algebraic

An algebraic number of degree d cannot be approached by fractions faster than the denominator's dth power. So a number that is approached faster than that is the root of no polynomial at all — and one can be built by choosing where its decimal digits go.

Number

Every fraction, exactly once

Take two fractions, add the tops and add the bottoms. That is not how fractions are added, it is not an average, and repeating it produces every positive rational exactly once, already in lowest terms.

Number

Every rational in one sequence

The tree lists every positive fraction once and needs a tree to do it. One recursion on the whole numbers lists them in a single row — and each term of it counts something nobody was asking about, which is why the enumeration works.

Number

How evenly the fractions spread

List every fraction between nought and one with denominator at most n, in order. They spread across the interval almost evenly, and how fast the unevenness shrinks as n grows is — exactly, provably — the Riemann hypothesis. The link runs through a second fact: set the fractions round a circle and add them as arrows, and what is left is a whole number.

Number

The arcs a line crosses on its way to a number

Draw a semicircle over every pair of neighbouring fractions and the half-plane above the number line is cut into curved triangles that never overlap. A straight line dropped towards any number crosses those arcs one after another, and the arcs it crosses, and the side it leaves each triangle by, are exactly the steps of the Stern–Brocot descent towards that number.

Number

The fractions that beat every smaller one

Walking down the tree towards a number produces a sequence of fractions closing in on it. Most of them are steps along the way; a few are the best approximations there are — closer than every fraction with a smaller denominator — and which few is decided by where the turns change direction.

Number

The function that sends fractions to binary

The Stern–Brocot tree and the tree of binary fractions have exactly the same shape, so there is a function that sends each fraction to the binary fraction in the same position. It is continuous and increasing, it turns every quadratic irrational into an ordinary fraction, and it does all of its rising on a set of numbers so thin that at almost every point its slope is nought.

Number

Three unit fractions for every four over n

Two neighbouring fractions in the tree always differ by a unit fraction, so stepping down the tree writes any fraction as a sum of them — four over n in at most four steps. Erdős and Straus asked in 1948 whether three always suffice. Three identities settle every n except those leaving remainder 1 on division by 24, a search settles every one anyone has tried, and nobody has a proof.

Number

Two matrices that generate the tree

A node of the Stern–Brocot tree is not really a fraction — it is the pair of fractions it lies between. Written as the columns of a matrix, the two turns of the tree become two multiplications, and the determinant that kept everything in lowest terms becomes a property of a product.

The whole library · What the figures prove