I am working on the evaluation of $$S \left({N}\right) = \sum_{s=1}^{N} \sum_{t=1}^{N} \left[{\sqrt{4t-s^2} \in \mathbb{Z}}\right]$$ and its asymptotic expansion where $N \ge 1$. Here $\sqrt{4t-s^2} \in \mathbb{Z}$ denotes a perfect square and $\mathbb{Z}$ is the set of integers. This should more accurately be $\mathbb{N}_{0}$. Also $[...]$ are the Iverson brackets. I expect that there is a closed form solution. For example the sum $$\sum_{s=1}^{N} \sum_{t=1}^{N} \left[{\sqrt{s^2-4t} \in \mathbb{Z}}\right] = \frac{1}{2} D \left({N}\right)+\frac{1}{2} \left\lfloor{\sqrt{N}}\right\rfloor-1$$ where $D \left({N}\right)$ is the summary divisor function. Numerical testing shows that $S \left({N}\right) \sim (3/4) N$. This tells me that the summary divisor function is absent in the solution.
Let's assume that $s = n + k$ and $t = n$ for some integer $k$. Then $4n - \left({n+k}\right)^{2} = {y}^{2}$ or ${y}^{2} + {x}^{2} = 4n$ where $x = n + k$. Factoring shows that $\left({x - y i}\right) \left({x + y i}\right) = 4n$. Now assume that $d \mid 4n$ such that for such pair of Gaussian divisors ${d}_{1} = x - y i$ and ${d}_{2} = x + y i$ where ${d}_{1} = \overline{{d}_{2}}$ we have ${d}_{1} {d}_{2} = 4n$. So the problem is reducible to counting the number of Gaussian conjugate pair divisors. On second thought I think that perhaps the requirement of conjugate pairs can be removed!
Let's assume that $s = n + k$ and $t = n$ for some integer $k$. Then $4n - \left({n + k}\right)^{2} = {y}^{2}$ or $n = \left({{x}^{2} + {y}^{2}}\right)/4$ where $x = n + k$. We can then write
\begin{equation*} S \left({N}\right) = \frac{1}{4} \sum_{k = 1}^{+ N} \sum_{\left\{{x, y}\right\}} \left[{\sqrt{{x}^{2} + {y}^{2}} \le N}\right] = \frac{1}{4} \sum_{k = 1}^{\sqrt{N}} {r}_{2} \left({k}\right) - {\delta}_{N = 1}. \end{equation*}
The correction is due to $S \left({1}\right) = 0$. The condition that ${x}^{2} + {y}^{2} \le {N}^{2}$ is the sum over the number of ways to write $k$ as a sum of two squares where $k$ varies from $1$ to $N$. This is known as Gauss's circle problem. From Benoit Cloitre, On the circle and divisor problem, November 2012, Eq. 3, we can write
\begin{equation*} G \left({n}\right) = \left\{{\left({x, y}\right) \in \mathbb{Z}^{2}: {x}^{2} + {y}^{2} \le {n}^{2}}\right\} = \sum_{k = 1}^{{n}^{2}} {r}_{2} \left({k}\right) \sim \pi\, {n}^{2} + {O} \left({{n}^{2\, {\theta}_{0}^{*} + \epsilon}}\right) \end{equation*}
where ${r}_{2} \left({k}\right)$ is the number of ways to write $k$ as a sum of $2$ integers. Also $1/4 < {\theta}_{0}^{*} \le 131/416$ from Huxley, M. N. Exponential sums and lattice points III, Proc. London math. Soc., 87 pp 591-609, 2003. This is related to the number of lattice points inside the boundary of a circle or radius $r$ with center at the origin,
\begin{equation*} {N}_{lattice} \left({r}\right) = 1 + 4 \sum_{i = 0}^{\infty} \left({\left\lfloor{\frac{{r}^{2}}{4\, i + 1}}\right\rfloor - \left\lfloor{\frac{{r}^{2}}{4\, i + 3}}\right\rfloor}\right) = \sum_{k = 0}^{{r}^{2}} {r}_{2} \left({k}\right). \end{equation*}
Thus, we can write
\begin{equation*} S \left({N}\right) = \frac{1}{4} \left({{N}_{lattice} \left({\sqrt{N}}\right) - {\delta}_{N = 1}}\right). \end{equation*}
The asymptotic expansion as $N \rightarrow \infty$ is then
\begin{equation*} S \left({N}\right) \sim \frac{{\pi}^{2}}{4}\, N + {O} \left({{n}^{{\theta}_{0}^{*} + \epsilon}}\right) \end{equation*}