Answers are grounded in this paper and cite their sources.
Let T(N) be the number of integer right triangles with perimeter at most N (A299706 for N=10^n). We prove the exact formula T(N) = sumr >= 1, r odd, squarefree R(floor(floor(N/2)/r)), where R(M) = #{(a,b) in N^2 : a < b < 2a, ab <= M}, in which neither a coprimality condition nor a parity condition appears. The function R(M) reduces to a sum sum floor(M/a) over an interval of length ~ sqrt(M), and the dual form involves the counting function Q of odd squarefree integers. A Dirichlet hyperbola split gives an algorithm with O(N3/4) operations. Replacing the sums of integer parts by a walk along the convex hull of the lattice points above the hyperbola (a descent in the Stern-Brocot tree with batched steps), and the evaluation of Q by blocks of equal floor(z/d^2), lowers the cost to O(N2/3 log^2 N) operations and O(N1/2) memory, against Theta(N) for the enumeration of primitive triples used for the entry. The method reproduces the ten listed terms of A299706 and computes T(10^n) for n=11,...,17; for example T(10¹⁷) = 258777325927633181. The C implementation evaluates T(10¹⁴) in 8.2 s, against 35 s for the O(N3/4) version, and T(10¹⁷) in 863 s; the measured growth between 10¹⁴ and 10¹⁷ is N0.67. The increments of T(10^n)/10^n agree with the constant ln(2)*ln(10)/pi^2 of the classical asymptotics T(N) ~ (ln(2)/pi^2)*N*ln(N) to 9 digits.
No takes yet. Share an insight, caveat, or question.
Mark Kim (2026) studied this question.
Synapse has enriched 8 closely related papers on similar clinical questions. Consider them for comparative context: