Two of the earliest programs for the Analytical Engine, run on the store and the mill as Babbage set them out, a day apart. 122 of the 123 things he wrote agree with what the operations do, and his own remark under the table explains the order of the first. The transcription is an AI agent’s.
Published manuscript · v1.1
01 / TWO PROGRAMS ON ONE SHEET
On 4 August 1837, Charles Babbage wrote out a program for his Analytical Engine. Its first operation multiplies b′ by a, and leaves the places where both numbers were kept empty. Its second operation multiplies b′ again. How can it use a number that is no longer there? The answer is in a remark Babbage wrote under the table, and it is the remark of a programmer. To find it, we ran his program exactly as he wrote it. The sheet is BAB/L/001, the first of a series the Science Museum’s catalogue describes as 27 sets of “notations of calculations” for the engine. It holds two programs, No. 1 of 4 August and No. 2 of the next day. Both work on the same pair of equations, ax + by + c = 0 and a′x + b′y + c′ = 0. The first eliminates x between them; the second finds x and y. Each program is a table, one row per operation. A row says what the mill, the engine’s arithmetic unit, makes, and what happens in the store: the columns of figure wheels, v1 to v9, that each hold one number. Raúl Rojas described this sheet in 2023 as the first computer program, reading its two tables as one program of 4 August. Here both tables were transcribed from the Museum’s scans by an AI agent, cell for cell, and run.
02 / RUN AS WRITTEN
The run is simple to describe. Take each row’s operation and columns from the sheet, and do the operation. Then check everything the row writes: each store cell, the mill’s entry, the formula on the right, and the accents on its variables. At the end, check the page’s “Composition”, the values of x and y it states, and its counts of operations and variables. The values are held as algebra, in Babbage’s own letters, not as numbers. So a check that passes holds for every value of a, b, c, a′, b′ and c′, not just for numbers chosen to test it. The model engine has no rule but those this sheet shows, and one choice nothing here depends on. A number taken from a column leaves it at zero. Its complement may be laid in another column as it is taken. A transfer from column to column complements again. Rojas described the same rules in 2017, from the same series of sheets, and Bromley (1982) described destructive reading, a number cleared from its column when it is read. Of 123 statements, 122 agree: all 42 of No. 1, and 80 of the 81 of No. 2. The x and y the run finds solve the equations (taking operation 12 as written; see 06). The counts on the cover for No. 2, “great 7, small 6, total 13” and “6 variables, 3 working, 9 occupied”, are what the run counts.
03 / TEN TURNS OF THE HAND
Back to the puzzle. Operation 1 of No. 1 multiplies b′ by a and leaves both their columns at zero. Operation 2 multiplies b′ by c, though b′ is no longer in the store. Babbage’s remark gives the reason. The mill makes a table of multiples of the multiplicand, and keeps it. So he ordered the products to use each table twice: b′ for operations 1 and 2 and, as the run shows, b for 3 and 4. He had thought of another order, which would have saved variables. He rejected it because it “would have caused the table of b′ made in the third operation to be destroyed and it must have been recomputed in the operation for b′c thus causing the loss of about ten turns of the hand.” (The operation numbers in the remark are read as those of the order he rejected.) So the run keeps a table standing until another operation comes between. With that one rule, every operand of both programs is to hand. The ten turns are Babbage’s figure. How long a table took to make is not on this sheet.
04 / THE NEXT DAY
No. 1 finds x, but it leaves the store spent. a, b and c have each been taken to the mill and left at zero. The next day, No. 2 finds y as well, and y needs a, b and c again. So as each is taken in operations 1 to 3, its complement is laid in another column at the same time: Ca in v8, Cc in v5, Cb in v9. On the back of the sheet Babbage defined the sign: “C … before any number signifies the Complement of that number as Ca means complement of a”. After x is found, operations 8 to 10 move them back, with nothing for the mill to do. Then the second half finds y. Keeping them costs three transfers and two more working variables. With the three operations that find y, No. 2 takes 13 operations and 9 variables, where No. 1 took 7 and 7, as the cover counts them.
05 / ACCENTS NAME NUMBERS
The accents are easy to overlook. Babbage writes v₁′ for the first new number v1 is given, and v₁″ for the second. The right-hand columns and compositions of the two programs name variables with accents 53 times. Every one is the number the run finds there. They name numbers, not columns. Operation 8 of No. 2 is written v₁″ = v₁ = a. The a that comes back from v8 is still v₁, the number v1 started with, though for seven operations it was somewhere else, as its complement.
06 / OPERATION 12
One row does not agree. No. 2 finds y from the first equation as (−c − ax)/b. Operation 11 makes ax. Operation 12 is marked as a subtraction; its mill column reads −c − ax, and its formula −v₃″ − v₅″. But subtracting one of c and ax from the other gives c − ax or ax − c, not −c − ax. Taken as Babbage wrote it, every cell after it agrees, y included. So does his composition of y, expanded through −cb′a + cba′ − c′ba + cb′a to (a′c − ac′)/(b′a − ba′). The algebra is right. What the row asks of the mill, to take both numbers negatively, no other row asks. Run strictly, with the machine’s own value carried on instead of the sheet’s, y comes out wrong. It is the only page of the series that does. Rojas prints the formula without comment.
The same program runs in the browser, compiled to WebAssembly: the mill and the columns of the store, stepped one operation at a time, the sheet laid out as Babbage laid it out with every cell checked, and the transcription in an editor that runs as you type.
WHAT THIS DOES NOT SHOW
- One sheet of 27. The rules here are those read off BAB/L/001. The rest of Series L has since been run (at f01dd61, 2624 of 2673 statements on 35 pages agree) and needed rules 12 to 32, each dated where it first appears and set against Babbage’s history sheets; one of them (L/015) qualifies the table rule: the table is made of the factor the next multiplication uses again.
- That another operation destroys the mill’s table comes from the remark; no row of this sheet tests it. That a transfer complements: the sheet shows only Ca going out and a coming back. Rojas explains it so (2017, 2023), and Babbage’s Sketch Book states it on 25 July 1836 (an AI agent’s reading).
- The “about ten turns of the hand” is quoted and not checked: how long a table took to make is not on this sheet.
- The transcription was made by an AI coding agent from the Museum’s scans, in one session. The scans are linked, and what was hard to read on the sheet is listed in the repository’s notes on it.
- Rojas 2017 and 2023 and Bromley 1982 have been read, Bromley 1990 searched, and a short search made; Bromley 2000 and Rojas 2021 were found and not read. Destructive reading and a mill that multiplies from a table of multiples are already in Bromley (1982) and Rojas (2017, 2023). That the cover dates No. 2 a day later, and the sign of operation 12, were not found in what was read. Nothing here is claimed as new.
A program that writes down every cell can be run again. Where it agrees, the machine was understood; where it does not, that is the place to look.
Do the other 26 sets run as written, and when does the engine they need change?
Answered in part since: every sheet with images, L/001 to L/027 (L/003 has none), has been run, and at f01dd61 2624 of 2673 statements on 35 pages agree; 14 pages have statements that do not, and one, this sheet’s back run strictly, ends with a wrong answer. Each rule a sheet needs beyond BAB/L/001 is dated where it first appears. What the disagreements are — slips, readings, or rules not yet found — is open; see the repository’s Status section.
Thematic notebook / Published record
Closing thought
Run as he wrote them, the two programs on Babbage’s sheet of 4 and 5 August 1837 agree with what their operations do in 122 of the 123 things the sheet states: every store cell, formula and accent, both compositions, the results and the counts. The sheet relies on the mill keeping a table of multiples between operations, as Babbage’s own remark explains, and its accents name numbers, not columns. The one disagreement is a subtraction whose result is written −c − ax.




