Search arXivSearch

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

Explore connections, maps & timelines

BibTeXRIS

Nuh Aydin, Mohammad K. Azarian, Omid Khormali, Ghaya Mtimet. 2026-07-29. 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

On the role of Giovanni Giorgi in the history of operational methods to mathematical-physics problems

In this paper we discuss the historical role played by Prof. Giovanni Giorgi (1871-1950) in the development of operational methods in mathematical physics. In the literature, the analysis of the scientific contributions of Giorgi is discussed in many historical papers mainly about the $MKSΩ$-system and its contributions in the field of electrical engineering. Starting from the obituary written by Prof. Dario Graffi (1905-1990), here we analyze in detail the contributions given by Giorgi in mathematical physics, especially in the framework of the studies started by Heaviside (1850-1925) in order to obtain a symbolic representation of the solutions of differential equations emerging in physical problems. \\ Moreover, we underline the little known contribution of Giorgi to the analysis of derivatives of any real order, namely fractional derivatives, according to the present notation. \\ The main aim of this note is to underline the historical relevance of Giorgi in the mathematical foundations of operational methods in relation to the solutions of concrete problems emerging in applied physics.

math.HO

Who Wrote This? Turing, Total Variation, and the Mathematics of AI-Text Detection

What can a finished text reveal about the process that produced it? Drawing on Turing's imitation game and statistical decision theory, this article examines the limits of AI-text detection as an inference from a completed object to an unobserved history. For two known source distributions with equal prior probabilities, a standard identity gives the minimum average classification error as half their probability overlap. This overlap is one minus their total variation distance. Perfect detection therefore requires nonoverlapping distributions; useful discrimination does not. In practice, the problem is harder: human and machine writing form changing families of distributions, posterior probabilities depend on base rates, and ``AI-written'' becomes ambiguous when people and software contribute to the same text. Turing's interrogator can ask another question; a detector restricted to finished prose cannot. Distinguishability, source attribution, authentication, and compliance are different inferential tasks. The paper's own documented human-AI provenance shows what a production history can reveal that a binary label cannot.

math.HO

LLAMA LIMA: A Living Meta-Analysis on the Effects of Generative AI on Learning Mathematics

The capabilities of generative AI in mathematics education are rapidly evolving, posing significant challenges for research to keep pace. Research syntheses remain scarce and risk being outdated by the time of publication. We present a Living Meta-Analysis (LIMA) on the effects of generative AI-based interventions for learning mathematics. We update the literature base every two months and apply a cumulative Bayesian multilevel meta-regression model. This paper reports results from the fifth version, including 34 studies, 7 of which were newly included since the fourth version. Results indicate an increasingly positive effect (g = 0.57, CrI [0.36, 0.79]) and no evidence in favor of a publication bias. Moderator analyses indicate that effects vary by integration mode and intervention duration: Larger effects were observed when generative AI supplemented teacher instruction and in longer interventions. Moderate evidence for stronger effects was observed in studies involving younger learners and more recent technology. For other moderators, evidence is still inconclusive.

math.HO