Linear Algorithm and Density Asymptotics for Huang's Quadratic Form
Year: 2026
Type: preprint
Abstract: Let $G = \mathbb{N} \setminus \langle a, b \rangle$ be the gap set of the numerical semigroup generated by coprime $a < b$, and $N = |G|$. Yifeng Huang (2026) defined the quadratic form $Q(n) = \sum K(j-i) n_i n_j$ on $\mathbb{R}^G$, where $K(d) = 1_{d \geq 0} - 1_{d \geq a} - 1_{d \geq b} + 1_{d \geq a+b}$, and showed that it recovers the dinv statistic on rational Dyck paths. The naive evaluation of $Q$ requires $O(N^2)$ operations. This paper extends these findings in two main directions: Linear-Time Evaluation ($O(N)$ Algorithm): We prove that the interval structure of $K$ allows one to reduce $Q$ to a linear combination of sliding-window sums, yielding an $O(N)$ algorithm (Theorem 1.1). Generalization to $n$ Generators: We generalize the framework to semigroups $\langle p_1, ..., p_n \rangle$ with $n$ generators. The generalized kernel $K^{(n)}$, defined by inclusion-exclusion with $2^n$ terms, has at most $w(n) \leq \sigma_n$ active windows due to parity cancellation. These windows are computable incrementally in time $O(n \cdot \sigma_n)$ (Theorem 1.2). Empirically, $w(n) \sim \sigma_n$ while $w(n) \ll 2^n$: exponential combinatorics reduces to a sparse interval structure. For a sequence of pairwise distinct integers $p_i \geq 2$ satisfying $\log p_n = o(n)$, we prove that the density of active windows becomes asymptotically negligible relative to the semigroup density (Theorem 1.5): $$\frac{w(n)}{2^n - 1} = o\left(\prod_{i=1}^{n} \left(1 - \frac{1}{p_i}\right)\right), \qquad n \to \infty$$ Version 2 adds the sharp bound $w(n) \leq 2^n - 2$ for $n \geq 2$ distinct positive generators (previously listed as an open problem), a corrected reference to the code repository, and layout fixes. Lean 4 / Mathlib formalization: the accompanying repository https://github.com/Flaman55/NumericalSemigroups contains machine-checked proofs of the linear-form identity (Theorem 1.1), of $w(n) \leq \sigma_n$, of the bound $w(n) \leq 2^n - 2$ and of the density asymptotics (Theorem 1.5), as well as proofs of Theorems 1.1 and 1.3 of Huang's paper (arXiv:2604.13238), built on the AxiomProver formalization of his Theorem 1.2. The running-time claims are not formalized. The formalization is registered in the Palomar registry as PALOMAR-2026-10-17-000016.
Author: Flamandzki, Artur
Language: English
Subfield: Discrete Mathematics and Combinatorics
Field: Mathematics
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W7161487227
Cites:
Cited by:
Related to:
