arXiv · 2609.28649
Straight-line programs for the solutions of Pell's equation
Abstract
For nonsquare $d\ge 2$, we construct fixed straight-line programs for the least non-trivial solution $(X_1,Y_1)$ of $x^2-dy^2=1$, using addition, truncated subtraction, multiplication, integer division, exponentiation, and remainder. A geometric-sum identity recovers $(X_1,Y_1)$ from the coordinate sums of an initial segment of Pell solutions, without knowing how many solutions were summed. Weighted binary encodings make these sums accessible to arithmetic computation. Counting operations with reuse of computed values, one program uses $94$ operations, with intermediate bit lengths bounded by $2^{2^{2^{O(d)}}}$. Four additional operations give a $98$-operation program with the bound $2^{2^{O(d)}}$. Hua's bound gives corresponding programs with $103$ and $107$ operations and replaces $O(d)$ by $O(\sqrt d\log d)$ in these size bounds. Once the fundamental solution is known, generating-function formulas compute the $n$-th positive solution in $21$ further operations by extracting its coordinates as base-$b$ digits. We prove that $2X_1(X_1+1)-1$ is the least integer base for which both formulas are defined and correct for every $n\ge1$.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Bogdan Dumitru, Mihai Prunescu. 2026-09-23. Straight-line programs for the solutions of Pell's equation. https://arxiv.org/abs/2609.28649
Cite the original work for its findings. Save a collection to share your selection of sources.