Calculate exactly and as $N \rightarrow \infty$ of $\sum_{k=1}^{\left\lfloor{N/2}\right\rfloor} \left[{\sqrt{{N}^{2}+{k}^{2}} \in \mathbb{Z}}\right]$

163 Views Asked by At

I am counting the number of cases where $\sqrt{{N}^{2}+{k}^{2}}$ is a perfect square as $k$ ranges from $1$ to $\left\lfloor{\frac{N}{2}}\right\rfloor$. For the sum $N$ is fixed. I don't know if a closed for expression is possible. However in the limit as $N \rightarrow \infty$ is very much needed to as many terms as possible.

This component arises from the calculation $$\sum_{k = 1}^{\left\lfloor{N/2}\right\rfloor} \left\{{\sqrt{{N}^{2} + {k}^{2}}}\right\} = \frac{1}{2}\, \left\lfloor{\frac{N}{2}}\right\rfloor -\frac{1}{2} \sum_{k=1}^{\left\lfloor{N/2}\right\rfloor} \left[{\sqrt{{N}^{2}+{k}^{2}} \in \mathbb{Z}}\right] - \frac{1}{\pi} \sum_{k = 1,\sqrt{{N}^{2}+{k}^{2}} \not\in \mathbb{Z}}^{\left\lfloor{N/2}\right\rfloor} arctan \left({\cot \left({\pi \sqrt{{N}^{2} + {k}^{2}}}\right)}\right)$$ where $\left[{...}\right]$ are Iverson brackets. Details of this question is posted as Find the asymptotic expansion as $N \rightarrow \infty$ of $\sum_{k=1}^{\left\lfloor{N/2}\right\rfloor} \left\{{\sqrt{{N}^{2}+{k}^{2}}}\right\}$. This part of a more general problem of counting the number of factorable quadratics of naive height $N$. Note that I recently corrected this expression.

So far numerical tests indicate that as $N \rightarrow \infty$ we have $\sum_{k=1}^{\left\lfloor{N/2}\right\rfloor} \left[{\sqrt{{N}^{2}+{k}^{2}} \in \mathbb{Z}}\right] \sim 1 + \cdots$.

This looks like it may be connected with Gauss Circle Problem.

These are the current accumulative results of $\sum_{N = 1}^{{N}_{max}}\sum_{k=1}^{\left\lfloor{N/2}\right\rfloor} \left[{\sqrt{{N}^{2}+{k}^{2}} \in \mathbb{Z}}\right]$

$$\begin{array}{ccc} {N}_{max} & \text{Accumulative Count} & \text{Average for } {N}_{max} & \text{Accumulative Count}/({N}_{max} \log \left({{N}_{max}}\right))\\ 1 & 0 & 0 & 0 \\ 10 & 0 & 0 & 0 \\ {10}^{2} & 22 & 0.22 & 0.0477724 \\ {10}^{3} & 436 & 0.436 & 0.0631175 \\ {10}^{4} & 6610 & 0.6610 & 0.0717672 \\ {10}^{5} & 88568 & 0.88568 & 0.0769292 \\ 2 \times {10}^{5} & 190668 & 0.95334 & 0.0781037 \\ 3 \times {10}^{5} & 297834 & 0.99278 & 0.07872 \\ 4 \times {10}^{5} & 408346 & 1.02087 & 0.0791416 \\ 5 \times {10}^{5} & 521315 & 1.04263 & 0.0794544 \end{array}$$ The case for $N = {10}^{5}$ reads that there were 88568 accumulative perfect squares between $N = 1$ and $N = {10}^{5}$ for an average of 0.88568 per $N$. Counting additional data that is not shown in this table the new estimate as $N \rightarrow \infty$ based on curve fitting is $\sum_{k=1}^{\left\lfloor{N/2}\right\rfloor} \left[{\sqrt{{N}^{2}+{k}^{2}} \in \mathbb{Z}}\right] \sim 0.08\times \log \left({N}\right) + \cdots$.

The goal is to show this derivation!

1

There are 1 best solutions below

1
On

This is a hyperbolic version of the Gauss circle problem (see also Chapter 8 of my notes).
By mimicking Gauss' approach it is pretty simple to prove that

$$ \sum_{k\leq N/2}\lfloor \sqrt{N^2+k^2}\rfloor = \int_{0}^{N/2}\sqrt{N^2+x^2}\,dx + O\left(\int_{0}^{N/2}\sqrt{\frac{N^2+2x^2}{N^2+x^2}}\,dx\right) $$ i.e. that $$ \sum_{k\leq N/2}\lfloor \sqrt{N^2+k^2}\rfloor = \left(\frac{\sqrt{5}}{8}+\frac{1}{2}\log\frac{1+\sqrt{5}}{2}\right)N^2+O(N). $$ Improving the error term beyond $O(N)$ is tricky but doable due to the smoothness of $\sqrt{N^2+x^2}$.
By mimicking Voronoi's approach we get $$ \sum_{k\leq N/2}\lfloor \sqrt{N^2+k^2}\rfloor = \left(\frac{\sqrt{5}}{8}+\frac{1}{2}\log\frac{1+\sqrt{5}}{2}\right)N^2+O\left(N^{2/3}\right). $$ This almost is the best we can get.
Like in the Gauss circle problem, it can be shown that the error term is $\gg N^{1/2}$ in infinite cases.