Alphabeta Math
AlgorithmAlgorithm: Literature-sourcedProof: Not applicablePipeline-generatedjudge pass (gpt-6-luna)
How statement and proof provenance work

The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.

  • Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
  • AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
  • AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.

These labels describe origin, not correctness: citations and verification chips remain separate evidence.

Extended-Euclidean modular inverse with bounded bit cost

Definition

Input an integer n≥2 and the least residue c∈{0,…,n−1}. Set (r−1,r0)=(n,c) and (s−1,s0)=(0,1). For i=0,1,…, divide

ri−1=airi+ri+1,0≤ri+1<ri,

and update si+1 to the least residue of si−1−aisi modulo n. Stop at the first index i for which ri+1=0. Return the least residue si if ri=1, and return NO_INVERSE otherwise. For c=0, the first division has zero divisor under this indexing; handle it separately by returning NO_INVERSE.

The algorithm uses binary integer arithmetic. Its correctness and O(B3) bit bound for B=⌈log⁡2(n+1)⌉ are proved in Correctness and bit cost of the modular inverse recurrence.

Depends on

Used by

Dependency tree · two levels

35 results within two dependency steps of this one, each drawn at its shortest distance from it. An arrow runs from a result to what uses it, so the chart reads left to right and ends at this result, which carries a heavier outline. Every node is a link to that result. Click elsewhere on the chart to enlarge it.

Sources