Exact Formulas for Coprime Representations of Even Integers Avoiding a Prime
Andres M. Salazar

TL;DR
This paper derives explicit, efficient formulas for counting coprime representations of even integers avoiding a prime, enabling quick computation compared to enumeration.
Contribution
It provides closed-form, piecewise affine formulas for the function g(2n,p), involving elementary functions and minimal solutions of specific congruences, improving computational efficiency.
Findings
Formulas validated for all 2n ≤ 10^5 and primes p in {5,7,11,13,17,19,23}
Each evaluation requires only O(1) operations after precomputation
The formulas show g(2n,p) is piecewise affine along arithmetic progressions
Abstract
Fix a prime and define . We derive explicit closed-form expressions for in terms of the canonical remainder operator , elementary step functions, and the minimal solutions of the congruences and . A key ingredient is an explicit formula for the minimal solution of obtained via the Euclidean algorithm, which determines the excluded residue classes directly. The resulting formulas show that is piecewise affine along arithmetic progressions of , governed by residue classes modulo and . For fixed , after precomputing two residue parameters in time, each evaluation of requires only operations, compared to for direct…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
