Exact Counting of Pythagorean Triangles with Bounded Legs: Sublinear Algorithms and New Terms of OEIS A239581, A239744, A239786
This paper provides an exact sublinear computation of the number of Pythagorean triangles with legs x < y <= N, considering both primitive triangles Q(N) and all triangles T(N). The problem is connected to the sequences A239581, A239744, and A239786 in the OEIS, where terms were previously known only up to N = 10^11. We demonstrate that the plane of Euclid pairs (m,n) is partitioned by the ray m = (1+sqrt(2))n into two symmetric hyperbolic regions under different coordinates: mn <= Y/2 and uv <= Y (with u=m-n, v=m+n). The boundary is evaluated exactly using Beatty floor sums with a 40-digit approximation of sqrt(2), and the coprimality condition is handled via Möbius inversion. The resulting algorithm achieves O(sqrt(N) log N) for Q(N) and O(N^(2/3)) for T(N). We successfully reproduce all 11 known OEIS terms and extend the sequences by computing new terms up to N = 10^17 for primitive triangles (a(17) = 17860363013590019) and N = 10^13 for all triangles.
Authors
- Mark Kim (ORCID: https://orcid.org/0000-0001-7601-831X)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-10-21
- DOI
- https://doi.org/10.5281/zenodo.23518200
- Primary Topic
- Analytic Number Theory Research
- Type
- preprint