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 enumeration. The formulas are validated computationally for all and primes , with perfect agreement with brute-force enumeration.

生成讲解博客的中文版本

生成AI智能校验的中文版本