Windowsill Lab · Field Explainer · Compute & Number Theory

Checking the arithmetic
before trusting it

Every other experiment on this ladder measures something. This one measures the instrument — and both of its checks run below, in your browser, on your machine.

40terms byte-identical
0final residue, M31
passthe run's own verdict
C01

A permission slip, not a result

Before a machine is allowed to claim anything about numbers, how do you check that it can do arithmetic correctly in the first place?

AI-painted illustration: brass jeweller's calipers at rest on a dark windowsill, a strip of pale paper tape running off the sill, and a single brass weight catching the lamplight
Illustration (AI-painted) — checked against a single standard

Every other experiment on this ladder measures something. This one measures the instrument. Before the lab is permitted to say anything about prime numbers or integer sequences, it has to demonstrate that its arithmetic is trustworthy — and trustworthy here means something stricter than it looks right.

The first half is a byte comparison. The Online Encyclopedia of Integer Sequences publishes the Fibonacci numbers as a plain text file, one term per line. The lab generates the first forty terms itself, from nothing but the recurrence, then compares its own output against the official file character for character — not as numbers, as bytes. Numbers can agree while the formatting, the indexing convention, or the encoding quietly disagrees. Bytes cannot. The retrieved source is 429,385 bytes and is pinned in the receipt by its SHA-256 hash, so the comparison can be re-run later against the same file it was originally run against.

The second half is a primality proof, run independently. The Lucas–Lehmer test decides whether a Mersenne number 2p − 1 is prime by a loop so simple it fits on one line: start at 4, then twenty-nine times over, square it, subtract two, and take the remainder modulo the candidate. The intermediate values are enormous. If the number is prime, and only if it is prime, the final residue is exactly zero. For 2³¹ − 1 the lab reached zero.

Live · Lucas–Lehmer on 2p − 1 · BigInt, in your browser REAL ARITHMETIC — COMPUTED HERE
p = step 0 / 29

left · the residue ledger — each row is the residue after one squaring step, nine or ten digits wide and visibly unrelated to the one before it · right · the same residues by magnitude. The loop is indifferent to how large the numbers are; only the last row means anything.

The exponent selector is not decoration. Four of those exponents produce a Mersenne prime and one does not: at p = 11 the number 2¹¹ − 1 is composite, and the loop lands on a large nonzero residue instead of zero. A test that only ever agrees is not a test. Watching this one refuse is worth as much as watching it confirm.

Live · byte-for-byte diff against the published OEIS prefix BUNDLED PUBLIC DATA — HASHED HERE
comparing…

left column · generated here from the recurrence alone · right column · the published A000045 b-file prefix, bundled into this page. The comparison is on UTF-8 bytes, not on parsed numbers — press corrupt one digit to see why that distinction is the whole point.

40terms matched byte-for-byte MEASURED
0final Lucas–Lehmer residue, M31 MEASURED
29iterations (p − 2, for p = 31)
429,385bytes of OEIS source, SHA-256 pinned

The graded run reports status: pass on both halves, and its verification step regenerates the bytes and re-runs Lucas–Lehmer rather than trusting a cached pass field. That is the difference between a receipt and an echo: a stored true proves only that something once wrote true.

A pass here is not a result. It is a permission slip — the thing that has to be true before the harder number-theory rungs on this track are allowed to mean anything.

This calibrates integer arithmetic and source-byte handling. It is not a new OEIS extension, not a GIMPS assignment, and not a submitted contribution — 2³¹ − 1 has been known to be prime since Euler proved it in 1772, and the point of re-deriving it is that the answer is already certain. A pass here is the permission slip for the harder rungs on this track, not a finding in its own right.