Work

Exact Counting of Lattice Points in Balls of Dimensions 6 and 8 in $O(\sqrt{N})$ Operations: Hyperbola Sums for the Sequences A055412 and A055414

Year: 2026
Type: preprint
Abstract: Let N_k(N) be the number of points of Z^k with squared norm at most N. The OEIS sequences A055412 and A055414 are a(n)=N_k(n^2) for k=6 and $k=8$. The numbers r_6(m) and r_8(m) of representations of m as a sum of six and eight squares are divisor sums (Glaisher). We prove that N_6(N) and N_8(N) are explicit combinations of the hyperbola sums sum_{d<=N} d^2 * c([N/d]), sum_{d<=N} chi(d) * d^2 * [N/d] and sum_{d<=X} d^3 * [X/d], where chi is the non-principal character modulo 4 and c is the indicator of m mod 4 in {1,2}. Each value is computed exactly with at most 4.5 * sqrt N blocks of constant quotient, that is O(n) operations for a(n), while the Python program of A055412 factors all m <= n^2 and the C++ program of its table costs Theta(R^3) for all terms up to R. The formulas reproduce all published terms. At n=1000 the Python program of A055412 takes 11.4 s and the formula 0.0057 s (0.00049 s in C); a(n) for n=10^8 takes 43.6 s in C for k=6.
Author: Kim, Mark
Language: English
Open Access status: green
OpenAlex ID: W7225572710
Cites:
Cited by:
Related to: 10