Answers are grounded in this paper and cite their sources.
For \( d ≥ 3 \) with \( -d ≡ 0, 1 4 \), let \( h(-d) \) be the number of classes of primitive positive definite binary quadratic forms of discriminant \( -d \). We prove that \( d ↦ h(-d) \) is computable in deterministic polynomial time with an oracle for a language in the second level \( Σ_2P \) of the polynomial hierarchy. The proof uses only reduction theory of binary quadratic forms, Lagrange's theorem and Hermite normal forms; it does not assume the generalized Riemann hypothesis, does not take a generating set of the class group as input, and uses no randomness. A \( Σ_2P \) oracle finds a generating set of \( O(log d) \) forms, and an NP oracle then determines the lattice of relations, whose index is \( h(-d) \). Consequently, if \( P = NP \), class numbers of imaginary quadratic fields are computable in polynomial time. As an application, the number \( D_n \) of representations of n by the ternary form \( 8x^2 + 2y^2 + 16z^2 \) in Tunnell's congruent number criterion equals \( 2h(-4n) \) for square-free \( n ≡ 2 8 \) and vanishes for square-free \( n ≡ 6 8 \); hence \( D_n \) lies in \( FP^{Σ_2P} \) on even square-free n, and an exact counting reduction from \( #SAT \) to \( D_n \) would collapse the polynomial hierarchy to \( Δ_3P \).
No takes yet. Share an insight, caveat, or question.
Frank Vega (2026) studied this question.
Synapse has enriched 8 closely related papers on similar clinical questions. Consider them for comparative context: