Efficient computation of the Jacobi symbol
Pith reviewed 2026-05-24 19:47 UTC · model grok-4.3
The pith
Any left-to-right GCD algorithm extends to compute the Jacobi symbol with one table lookup per reduction.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
The family of left-to-right GCD algorithms reduces input numbers by repeatedly subtracting the smaller number, or multiple of the smaller number, from the larger number. This paper describes how to extend any such algorithm to compute the Jacobi symbol, using a single table lookup per reduction. For both quadratic time GCD algorithms and subquadratic algorithms, the additional cost is linear, roughly one table lookup per quotient in the quotient sequence.
What carries the argument
A fixed lookup table that updates the Jacobi symbol invariant during each reduction step of the underlying GCD algorithm.
If this is right
- Jacobi symbol computation adds only linear overhead to quadratic-time GCD algorithms such as Euclid and Lehmer.
- The same linear overhead applies when the base algorithm is subquadratic, such as Knuth or Schönhage.
- The table method integrates directly into existing GCD implementations without altering their quotient sequence.
Where Pith is reading between the lines
- The same table technique could be tested on other invariants preserved by GCD reductions, such as the Kronecker symbol.
- Implementations could measure whether the table fits in cache for typical word sizes and thereby confirm the linear cost in practice.
Load-bearing premise
A fixed table of size independent of the input numbers correctly updates the Jacobi symbol invariant for every possible reduction step.
What would settle it
A concrete reduction step on some pair of inputs where the table produces an incorrect update to the Jacobi symbol value.
read the original abstract
The family of left-to-right GCD algorithms reduces input numbers by repeatedly subtracting the smaller number, or multiple of the smaller number, from the larger number. This paper describes how to extend any such algorithm to compute the Jacobi symbol, using a single table lookup per reduction. For both quadratic time GCD algorithms (Euclid, Lehmer) and subquadratic algorithms (Knuth, Sch\"onhage, M\"oller), the additional cost is linear, roughly one table lookup per quotient in the quotient sequence. This method was used for the 2010 rewrite of the Jacobi symbol computation in GMP.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper describes a method to extend any left-to-right GCD algorithm (including Euclid, Lehmer, Knuth, Schönhage, and Möller) to compute the Jacobi symbol via a single fixed table lookup per reduction step. The additional overhead is linear in the number of quotients, and the technique was deployed in the 2010 GMP rewrite of its Jacobi symbol routine.
Significance. If the explicit table and update rules are correct, the result supplies a practical, low-overhead way to obtain the Jacobi symbol alongside GCD computations. The GMP implementation supplies external, production-grade corroboration that the construction works for both quadratic and subquadratic algorithms.
minor comments (1)
- [Abstract] Abstract: the phrase 'Schönhage' contains a literal backslash; ensure the final version renders the umlaut correctly.
Simulated Author's Rebuttal
We thank the referee for their positive summary of the paper, their assessment of its significance for both quadratic and subquadratic GCD algorithms, and their recommendation to accept.
Circularity Check
No significant circularity detected
full rationale
The manuscript is a constructive algorithmic paper that exhibits an explicit fixed-size table and per-reduction update rules to extend any left-to-right GCD algorithm to also track the Jacobi symbol invariant. Because the central claim is discharged by supplying the concrete table and the update logic (rather than assuming it or deriving it from prior self-citations), none of the enumerated circularity patterns apply; the derivation chain is self-contained and externally verifiable by direct inspection of the supplied construction.
Axiom & Free-Parameter Ledger
axioms (1)
- domain assumption The Jacobi symbol satisfies the same multiplicative and sign-change rules as the Legendre symbol under the reductions performed by left-to-right GCD algorithms.
Lean theorems connected to this paper
-
IndisputableMonolith/Cost/FunctionalEquation.leanwashburn_uniqueness_aczel unclear?
unclearRelation between the paper passage and the cited Recognition theorem.
The state is updated by the function jupdate... nine bits... lookup table consisting of 2^9 six-bit entries
-
IndisputableMonolith/Foundation/AlexanderDuality.leanalexander_duality_circle_linking unclear?
unclearRelation between the paper passage and the cited Recognition theorem.
If both a and b are odd, then (a|b) = (−1)^(a−1)(b−1)/4 (b|a)
What do these tags mean?
- matches
- The paper's claim is directly supported by a theorem in the formal canon.
- supports
- The theorem supports part of the paper's argument, but the paper may add assumptions or extra steps.
- extends
- The paper goes beyond the formal theorem; the theorem is a base layer rather than the whole result.
- uses
- The paper appears to rely on the theorem as machinery.
- contradicts
- The paper's claim conflicts with a theorem or certificate in the canon.
- unclear
- Pith found a possible connection, but the passage is too broad, indirect, or ambiguous to say the theorem truly supports the claim.
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.