From Counters to Programs

From ancient counting devices to mechanical calculators and programmable machines, Article 2 follows the long transition from recording quantities to automating calculation.

Share
From Counters to Programs

The Road to Artificial Intelligence — Part 2 of 15

WHEN NUMBERS BECAME MACHINES

Once people could record quantities and procedures outside individual memory, they could ask how devices might assist with—or even perform—calculation.

A counter moved across a surface. A number was written on a tablet. Gears embodied astronomical relationships. A sequence of punched holes directed a loom. Centuries later, punched cards would form part of the design for a proposed mechanical computer.

The path from these practices to artificial intelligence was neither direct nor inevitable. Again and again, however, humans found ways to represent quantities, procedures, and patterns in forms that could be preserved, inspected, and eventually acted upon by machines.

Numbers outside the mind

The earliest history of calculation is difficult to recover. Human beings surely counted using bodily and spoken methods, but the evidence is indirect. External techniques—tallies, tokens, counters, and written numerals—are more securely documented.

As the previous article described, the Rhind Mathematical Papyrus, produced around 1550 BCE, preserves 84 worked problems and procedures used in scribal education. It was not a computer program; its methods belonged to the mathematical culture of ancient Egypt. Even so, it demonstrates an important development: operations could be recorded as repeatable procedures rather than held only in memory.

Once written down, a procedure could be taught, copied, checked, and adapted. Calculation was becoming an external practice.

Other societies developed their own methods. The Antikythera Mechanism, built in ancient Greece around the second or first century BCE, was an exceptionally sophisticated geared astronomical instrument. Its mechanisms represented important calendrical and celestial cycles. Although not a general-purpose computer, it showed how numerical relationships could be embodied in physical machinery.

The machine did not "think" about the heavens. Its gears carried out relationships that humans had designed into it.

From arithmetic to algorithms

The history of calculation also depended on notation and the transmission of knowledge across cultures.

The Persian mathematician Muhammad ibn Musa al-Khwarizmi wrote works on arithmetic and algebra in the ninth century. His original Arabic arithmetic text has not survived, and historians reconstruct its influence through later manuscripts and Latin adaptations. Those adaptations helped transmit decimal calculation in medieval Europe.

The Latinized form of al-Khwarizmi's name contributed to the word algorismus, which eventually became "algorithm." In its modern sense, an algorithm is a specified procedure for carrying out a task. Historically, however, the crucial development was not the work of a single inventor but the wider process by which numerical methods became portable instructions.

An algorithm need not be performed by a machine. A person can follow one using pen and paper. The essential feature is that the procedure is expressed clearly enough to be repeated.

Mechanical assistance

By the seventeenth century, inventors were trying to mechanize arithmetic itself.

Schickard's letters from 1623 provide the earliest known documentation of a mechanical four-function calculator. His design combined Napier's calculating rods with toothed wheels. No original machine survives, so its exact operation must be inferred from documentary evidence and later reconstruction.

Blaise Pascal's Pascalines, built a few decades after Schickard's, were mechanical adding machines that could also subtract but not directly multiply or divide. The commonly cited figure of about 50 may include prototypes as well as successive models. Institutional accounts suggest numerous experimental versions and about 20 finished machines, with the number sold uncertain.

Rather than replacing mathematics, these machines addressed a narrower problem: how could repeated arithmetic be transferred from the human hand to a mechanism?

Gottfried Wilhelm Leibniz pursued a more ambitious design. His stepped-drum calculator was intended to support addition, subtraction, multiplication, and division. Its influence was considerable, although the operational status of Leibniz's own machines remains debated.

Leibniz also published a systematic account of binary arithmetic. Binary notation would later become central to digital computing, though there was no direct line from his work to electronic computers. Its later importance resulted from developments he could not have anticipated.

Instructions made physical

A major change came when machines began receiving instructions in an external form.

The Jacquard loom, refined in the early nineteenth century, used punched cards to control weaving patterns. It was not the first punched-control system: Basile Bouchon and Jean-Baptiste Falcon had developed earlier methods using perforated paper and punched cards. Jacquard refined the approach into an influential industrial system.

The cards did not describe every movement in anything resembling a modern programming language. They encoded pattern information that the loom could repeatedly execute, separating pattern preparation from the repeated mechanical work of weaving.

In a limited historical sense, this was programmability: changing an external sequence of instructions or controls could alter a machine's behavior.

Babbage's engines

Charles Babbage brought several of these ideas together in two ambitious designs.

His Difference Engine was a special-purpose machine intended to calculate mathematical tables using finite differences and repeated addition. A portion of Difference Engine No. 1 was completed and demonstrated, but the full machine was not finished during Babbage's lifetime.

Powerful in concept but limited in purpose, the Difference Engine was designed to calculate particular classes of numerical tables.

Babbage's Analytical Engine was different. It was a proposed general-purpose programmable mechanical computer with a Store for numerical values, a Mill for arithmetic operations, punched-card input, and mechanisms for repetition and conditional branching.

Its architecture anticipated several features associated with later computers: storage, processing, control flow, input, and output. The complete machine, however, was never built or demonstrated. It anticipated programmable computation without using the later electronic stored-program architecture, in which instructions and data could reside in a shared, modifiable memory.

The Analytical Engine therefore belongs to the history of both machines and unrealized designs. Its importance lies not only in its design, but also in what its architecture made imaginable.

Lovelace and the problem of authorship

In 1842, the Italian engineer Luigi Federico Menabrea published a French description of the Analytical Engine. Ada Lovelace translated it into English, and her translation, together with extensive Notes, appeared in Scientific Memoirs in 1843. Lovelace developed the Notes in close intellectual collaboration with Babbage.

One note described a procedure for calculating Bernoulli numbers. Lovelace's work is often summarized by calling her "the first programmer," but that label requires qualification.

Lovelace published the first widely recognized detailed algorithm for a proposed general-purpose mechanical computer. Babbage, however, had earlier prepared program-like instructions and made substantial contributions to the collaboration. The title "first programmer" depends on how one defines a program, publication, authorship, and priority.

The most defensible historical view is collaborative. Lovelace helped explain the broader potential of the Analytical Engine, while Babbage contributed its mechanical and architectural design. Neither contribution should erase the other.

The Connection to AI

Modern artificial intelligence depends on computing systems that can represent information, apply procedures, and alter their behavior according to encoded instructions. The earlier history described here contributed several elements of that computational foundation:

  • written procedures made operations repeatable;
  • numerical notation made quantities portable;
  • mechanical calculators transferred parts of arithmetic into machines;
  • punched cards showed how external information could control machinery;
  • Babbage's designs separated storage, arithmetic, and control;
  • Lovelace's Notes helped articulate the idea that a machine might manipulate symbols according to rules.

None of these developments aimed toward artificial intelligence in any predetermined sense. Ancient scribes, clockwork designers, loom engineers, and nineteenth-century mathematicians were solving problems specific to their own societies.

Across very different periods, however, humans repeatedly devised ways to make information stable enough for procedures to be repeated by people—or, increasingly, by machines.

Computation requires more than numbers. It also requires representations, rules, and a mechanism capable of following them. Artificial intelligence would emerge much later, as programmable computers made it possible to pursue increasingly complex attempts to automate reasoning, learning, and pattern recognition.

Looking Ahead

Mechanical calculation and punched control were not enough to produce modern computing. The development of modern computing would also depend on formal ways to represent logical choices, reliable electrical signaling, and systems for processing coded records.

The next article follows those parallel developments—from algebraic logic and telegraphy to punched-card tabulation and electrical switching—before the emergence of stored-program computers.

SOURCES

  • British Museum, The Rhind Mathematical Papyrus, British Museum Collection Online, object EA10057.
  • Computer History Museum, Schickard's Calculator and The Pascaline.
  • Computer History Museum, The Leibniz Step Reckoner and Curta Calculators.
  • Computer History Museum, The Engines.
  • Computer History Museum, A Brief History.
  • Luigi Federico Menabrea, translated and annotated by Ada Lovelace, "Sketch of the Analytical Engine invented by Charles Babbage, Esq.," Scientific Memoirs, 1843.
  • Tony Freeth and collaborators, "Decoding the ancient Greek astronomical calculator known as the Antikythera Mechanism," Nature, 444, 587–591, 2006. DOI: 10.1038/nature05357.
  • André Allard, "The Arabic Origins and Development of Latin Algorisms in the Twelfth Century," Arabic Sciences and Philosophy, 2008.
  • Florin-Stefan Morar, "Reinventing machines: the transmission history of the Leibniz calculator," British Journal for the History of Science, 2014.
  • Thomas J. Misa, "Charles Babbage, Ada Lovelace, and the Bernoulli Numbers," 2023, arXiv:2301.02919, preprint.
  • Science Museum Group, "Model of Falcon's loom."
  • Smithsonian Institution, National Museum of American History, "Stylus-Operated Adding Machines," accessed September 28, 2026.
  • ACONIT/Inria, "Histoire des machines: La Pascaline," Musée virtuel de l'informatique, accessed September 28, 2026.
  • Blaise Pascal, "Avis nécessaire à ceux qui auront curiosité de voir la Machine d'Arithmétique et de s'en servir," 1645.

← Previous in the series

Part 1 — What Had to Happen Before Artificial Intelligence?

Continue the series →

Part 3 — Logic, Signals, and the Machines That Came Before AI