SearcharxivSearch

arXiv · 2606.00958

On the History of the Square and Multiply Algorithm

Abstract

The square-and-multiply algorithm, also known as binary exponentiation or repeated squaring, is a standard method for fast exponentiation in modern computation. Its historical origins, however, remain uncertain. This paper examines the emergence and progressive formalization of the method through selected primary sources. Particular attention is given to Jamshid al-Kashi's fifteenth-century Miftah al-Hisab, where the procedure is presented explicitly as a general computational method and claimed by al-Kashi as his own innovation. Earlier instances of successive squaring are identified in the works of al-Uqlidisi and al-Biruni, although in these cases the technique appears in particular calculations rather than as a fully articulated general rule. The earliest known antecedent is found in Pingala's prosodic studies in ancient India (c. 200 BCE), which seem to presuppose the conceptual basis of the method in their use of binary representation. As part of the historical development, Legendre's 1798 worked example is one of the earliest documented European use of the algorithm which appears as a subordinate step within a specific number-theoretic computation. The evidence suggests not a single continuous line of transmission, but the repeated independent reappearance of related procedures in distinct contexts. By the twentieth century, square-and-multiply became a special case within the broader theory of addition chains. By exploring this intellectual progression, this paper sheds some light on the historical background of an algorithm that is prominent in modern computation.

Explore related subjects

Keep this discovery

BibTeXRIS

Nuh Aydin, Mohammad K. Azarian, Omid Khormali, Ghaya Mtimet. 2026-05-31. On the History of the Square and Multiply Algorithm. https://arxiv.org/abs/2606.00958

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Perspectives on the unit distance problem

This is a survey on an old open problem in combinatorics called the unit distance problem, and the field of mathematics around it, called incidence geometry. What do we know about the problem? Why is it difficult? How does it connect with other parts of math?

math.HO

A Categorical Approach to Euclidean Ratios and Proportions

A categorial approach to the non-metric geometry in Books V and VI of Euclid's \textit{Elements} is presented. Specifically, we introduce a diagrammatic syntax that can be overlaid immediately on his diagrams, thus bridging intuitive presentation with fidelity to Euclid's arguments. This syntax makes complicated definitions like V.5, and indeed the arguments throughout books V and VI, including arguments about similar figures, intuitively clear. We show in an appendix that this syntax can be used to solve a puzzle regarding ancient mathematics. Finally, we offer evidence that this approach to Euclidean diagrams is rooted in the Aristotelian tradition itself, and that a similar syntax was utilized, in antiquity, for related questions of numeric and proportions. Thus the syntax is plausibly faithful to Euclid's own thought-world, and not an outside-imposition.

math.HO

Some Early Results by Tutte Regarding the Cycle Double Cover Conjecture in 1948

OpenAI recently announced a proof of the Cycle Double Cover (CDC) Conjecture. Most media reports have characterized it as a 50-year-old open problem. In reality, according to a 1987 letter from Tutte to Fleischner, the Cycle Double Cover Problem has been open for at least 80 years. Two early results regarding the CDC conjecture were established in one of Tutte's 1949 publications.

math.HO