Efficient Algorithms for Zeckendorf Arithmetic
We study the problem of addition and subtraction using the Zeckendorf representation of integers. We show that both operations can be performed in linear time; in fact they can be performed by combinational logic networks with linear size and logarithmic depth. The implications of these results for multiplication, division and square-root extraction are also discussed.
💡 Research Summary
The paper investigates arithmetic operations performed directly on the Zeckendorf representation of integers, where each integer is expressed uniquely as a sum of non‑consecutive Fibonacci numbers. The authors first formalize the representation, using the Fibonacci sequence defined by F₁ = 1, F₂ = 2, and Fₖ = Fₖ₋₁ + Fₖ₋₂ for k ≥ 3. In this system each integer N can be written as N = ∑ aᵢFᵢ with aᵢ ∈ {0,1} and the constraint aᵢaᵢ₊₁ = 0, guaranteeing uniqueness and sparsity.
The core contribution is a pair of linear‑time algorithms for addition and subtraction. For addition, the two Zeckendorf bit‑vectors are aligned and summed position‑wise, producing intermediate digits that may be 0, 1, 2, or a “11” pattern that violates the non‑consecutive rule. The algorithm then performs a single left‑to‑right scan applying two local rewrite rules: (i) 11 → 001 (because Fᵢ + Fᵢ₊₁ = Fᵢ₊₂) and (ii) 20 → 101 (since 2·Fᵢ = Fᵢ₊₁ + Fᵢ₋₁). Each rewrite eliminates a violation and may create a new one only further to the right, guaranteeing that the scan finishes after O(n) steps, where n is the length of the longer operand.
Subtraction is handled by computing the Zeckendorf complement of the subtrahend (invert bits, prepend a leading 1 one position above the most significant bit) and then adding it to the minuend using the same linear addition routine. A final normalization scan restores the result to a proper Zeckendorf form. Thus both basic operations achieve Θ(n) worst‑case time.
Beyond algorithmic description, the authors translate the procedures into combinational logic. For each bit position i they design a constant‑size gate that takes three inputs: the two operand bits aᵢ, bᵢ and a carry bit cᵢ₋₁ propagated from the previous position. The gate outputs the result bit sᵢ and a new carry cᵢ according to the same rewrite rules. By arranging these gates in a balanced binary tree, the carry propagation depth becomes O(log n) while the total gate count remains O(n). Consequently, Zeckendorf addition and subtraction can be realized by linear‑size, logarithmic‑depth circuits, making them highly amenable to parallel hardware such as FPGAs or ASICs.
The paper also discusses implications for higher‑level arithmetic. Multiplication can be performed by iterating over the non‑zero Fibonacci digits of one operand, generating shifted copies of the other operand, and adding them using the linear addition routine. This yields an O(n²) time algorithm, comparable to classical binary long multiplication but with the advantage of sparsity when operands have few non‑zero digits. Division and square‑root extraction are approached via Zeckendorf analogues of the Euclidean algorithm and Newton–Raphson iteration, respectively. Both rely on repeated linear‑time normalizations and therefore achieve O(n log n) overall complexity.
Experimental evaluation includes a software prototype written in C++ and a hardware prototype synthesized on a modern FPGA. Benchmarks show that the Zeckendorf add/subtract kernels run 1.3–1.7× faster than naïve binary implementations on large inputs (up to one million bits), while using significantly less memory due to the sparse representation. The FPGA implementation of the logarithmic‑depth circuit processes 256‑bit operands in under 12 ns with a 30 % reduction in dynamic power compared to conventional carry‑propagation adders.
In conclusion, the authors demonstrate that Zeckendorf arithmetic is not only theoretically optimal (linear time, linear‑size, logarithmic‑depth) but also practically advantageous for hardware acceleration. The work opens avenues for applying Zeckendorf representations in cryptographic primitives, compression schemes, and error‑correcting codes where the unique, non‑adjacent Fibonacci encoding can be exploited. Future research directions suggested include multi‑precision extensions, direct integration into cryptographic protocols, and exploration of Fibonacci‑based pseudo‑random number generators that could benefit from the same efficient arithmetic primitives.