English

Enhanced Algorithms for the Representation of integers by Binary Quadratic forms: Reduction to Subset Sum

Number Theory 2025-03-04 v2 Combinatorics

Abstract

In this paper, we present efficient algorithms for solving the Diophantine equation f(x,y)=mf(x, y) = m for an arbitrary definite binary quadratic form ff, given the factorization of mm. While Cornacchia's algorithm to solve x2+dy2=mx^2 + dy^2 = m is efficient in many cases, its runtime becomes exponentially large when mm is highly composite and encounters subtleties when generalized to arbitrary forms ff. To address these issues, we give a reduction from our problem to an instance of the Subset sum, a weakly NP complete problem, allowing for more efficient solutions. Leveraging this approach, we develop deterministic algorithms that adapt to different cases based on disc(f)\mathrm{disc}(f) and m m . In particular, when disc(f)=polylog(m)|\mathrm{disc}(f)| = \mathrm{polylog}(m) , we provide a polynomial time solution that remains efficient regardless of the structure of m m . For more general cases, we present an algorithm that improves upon Cornacchia's method, achieving a quadratic speedup. Recently, the problem of representing integers by a form f f found important applications in elliptic curves and isogeny based cryptography, where these algorithms are central to solving norm form equations.

Keywords

Cite

@article{arxiv.2502.11402,
  title  = {Enhanced Algorithms for the Representation of integers by Binary Quadratic forms: Reduction to Subset Sum},
  author = {Maher Mamah},
  journal= {arXiv preprint arXiv:2502.11402},
  year   = {2025}
}

Comments

This is a new version of the paper, that generalized the previous version to arbitrary form. It also enhanced the follow and the structure

R2 v1 2026-06-28T21:46:32.550Z