Generator

sieve

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

sieve 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.

At its defaults

The sieve of Eratosthenes below 100A grid of the whole numbers with the composites struck out by the prime that removes them.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100every composite struck once, by its smallest prime factor25 squares are left standing, and they are the primes below 100

show: "counts"

π(x) below 1000A staircase counting the primes, with x over the natural logarithm of x beside it.0501001502004006008001e+3xπ(x), the primes up to xπ(x)x / ln xπ(1000) = 168, counted off the sieve; x / ln x says 145

show: "gaps"

The gaps between primes below 600One bar per consecutive pair of primes, its height the distance between them.261014the widest gap below 600 is 18, after 523and nothing in the picture suggests a ceiling, because there is not one

show: "euclid"

Euclid's construction on 2, 3, 5, 7The product of the listed primes plus one, divided by each of them in turn; every division leaves one over.2 × 3 × 5 × 7 + 1 = 211every listed prime tiles the product exactly, and then meets the extra unit÷ 21 left÷ 31 left÷ 51 left÷ 71 leftso no prime on the list divides 211211 is itself prime — but the argument never needed it to be

What it checks while it draws

Collected by running the family and listening to lib/verify.js, not written here. The count is how many separate times this build put that claim to the test.

Where it is called

Changing this generator changes every figure on this list. That is what makes the list worth publishing rather than keeping in a check script.

The whole library · What the figures prove