Answers are grounded in this paper and cite their sources.
Let a(n) be the number of pairs of non-negative integers (x, y) satisfying x^2 + 2*y^2 <= n^2, corresponding to the OEIS sequence A218706. The current entry provides enumeration programs and a column sum costing O(n) integer square roots. This paper generalizes the problem to diagonal quadratic forms w_x * x^2 + w_y * y^2 <= M for positive integers w_x, w_y and M >= 0. We prove that the number of points with x, y >= 1 equals A_x + A_y - X_0 * Y_0, where A_x and A_y are column and row sums over the boundary split by the point of slope -1 (with coordinates X_0, Y_0). Each sum is evaluated by a sublinear walk along the upper convex hull of the lattice points in the ellipse, where every step uses exact integer arithmetic. The Stern-Brocot descent step is solved in closed form via a convex quadratic in one integer variable. The method covers both A218706 and the classic Gauss circle sequence A000603 as special cases. The algorithm requires approximately 2 * M^(1/3) iterations, verified numerically against all published terms and independent counts up to M = 10^11. In Python 3.12, the value a(10^9) = 555,360,368,123,355,523 is computed in 9.6 s, and a(10^10) takes 50.8 s, significantly outperforming standard O(n) approaches.
No takes yet. Share an insight, caveat, or question.
Mark Kim (2026) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: