Table of Contents
Fetching ...

Exact Formulas for Coprime Representations of Even Integers Avoiding a Prime

Andres M. Salazar

Abstract

Fix a prime $p \ge 5$ and define $g(2n,p)=\#\{(h,k)\in\mathbb{Z}_{>0}^2 : h+k=2n,\; h\le k,\; \gcd(h,6p)=\gcd(k,6p)=1\}$. We derive explicit closed-form expressions for $g(2n,p)$ in terms of the canonical remainder operator $δ_k(x)=x-k\lfloor x/k\rfloor$, elementary step functions, and the minimal solutions of the congruences $6x \equiv -1 \pmod{p}$ and $6x \equiv -5 \pmod{p}$. A key ingredient is an explicit formula for the minimal solution of $δ_k(a_0 x)=b_0$ obtained via the Euclidean algorithm, which determines the excluded residue classes directly. The resulting formulas show that $g(2n,p)$ is piecewise affine along arithmetic progressions of $n$, governed by residue classes modulo $3$ and $p$. For fixed $p$, after precomputing two residue parameters in $O(\log p)$ time, each evaluation of $g(2n,p)$ requires only $O(1)$ operations, compared to $O(n)$ for direct enumeration. The formulas are validated computationally for all $2n \le 10^5$ and primes $p \in \{5,7,11,13,17,19,23\}$, with perfect agreement with brute-force enumeration.

Exact Formulas for Coprime Representations of Even Integers Avoiding a Prime

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

Paper Structure

This paper contains 15 sections, 22 theorems, 110 equations, 1 figure, 2 algorithms.

Key Result

Lemma 2.1

For all $a \in \mathbb{Z}$ and $k \ge 2$, $\blacktriangleleft$$\blacktriangleleft$

Figures (1)

  • Figure 1: Graphs of $g(2n,p)$ for $p\in\{5,7,11\}$ and $2n\le 10^5$.

Theorems & Definitions (47)

  • Lemma 2.1
  • proof
  • Lemma 2.2
  • proof
  • Lemma 2.3
  • proof
  • Lemma 2.4
  • proof
  • Lemma 2.5
  • proof
  • ...and 37 more