In a previous question: (The Gauss circle problem on a hexagonal lattice) I asked for an analytic approximation for the number of lattice points in or along the contour of a circle centered on a lattice point in an $A_2$ hexagonal lattice. The user emiliocba noted that such an approximation was provided by:
Lax, P.D., Phillips, R.S. The asymptotic distribution of lattice points in Euclidean and non-Euclidean spaces. J. Funct. Anal. 46(3), pp. 280 – 350 (1982).
With a best current error term of $O(r^{\frac{2}{3}})$ provided by:
Levitan, B.M. Asymptotic formulae for the number of lattice points in Euclidean and Lobachevskii spaces. Russian Mathematical Surveys 42(3), pp. 13 – 42 (1987).
My question is now if there exists an exact counting solution for the number of points within a circle of radius $r$ centered on a lattice point in an $A_2$ hexagonal lattice. We know that an exact counting solution exists for the $Z^2$ integer lattice using the Floor[] function (see – http://mathworld.wolfram.com/GausssCircleProblem.html ):
$N(r) = 1 + 4*Floor[r] + 4*\sum^{Floor[r]}_{i=1} Floor[(r^2-i^2)^{\frac{1}{2}}]$
Can we write a similar counting function for the $A_2$ lattice?
For a list of example values, the number of lattice points in a circle of diameter $r$ (i.e. radius $\frac{r}{2}$) centered on a lattice point in an $A_2$ hexagonal lattice, is given in (http://oeis.org/A053416/list).
For $n = {0, 1, 2, …}$ we have $N(r) = {1, 1, 7, 7, 19, 19, 37, 43, 61, 73, 91}$.
Best Answer
This Mathematica formula reproduces the numbers in the OEIS and should be self explanatory:
http://oeis.org/A053416 has the values corresponding to n[1/2], n[1], n[3/2], n[2] etc.
Assuming the lattice is generated by $(0,1)$ and $(\sqrt{3}/2,1/2)$, then the first sum counts the number of points of the form $(\sqrt{3}x,y)$ where $x,y\in\mathbb{Z}$, $\sqrt{3}x\le r$, and $3x^2+y^2\le r^2$. The second sum counts the number of points of the form $(\sqrt{3}x,y)$ where $x,y\in(\mathbb{Z}+1/2)$, $\sqrt{3}x\le r$, and $3x^2+y^2\le r^2$.