This problem looks simple, but I searched around and couldn't find any similar problems or related resources. Hope someone could provide a clue or at least a hint of what class of prolbems it belongs to.


A = { [$m$, $n$] | $m$ and $n$ are positive integer numbers} is a set of 2-D lattice points


R = { $r$ | $r^2$ = $m^2$ + $n^2$ } is a set whose elements are the distance between the origin and the lattice points in the set A. 


The problem is:


If we sort all the $r$ from set R and use these sorted $r$ to creat a series C = {$r{\_1}$, $r{\_2}$, $r{\_3}$..., $r{\_N}$}, where $r\_i$ $\in$ R and $N\to\infty$, so that $r{\_1}$ $\leq$ $r{\_2}$ $\leq$ $r{\_3}$... $\leq$ $r{\_N}$, and we define $\Delta$$r{\_i}$ = $r\_i$$\_+$$\_1$ $-$ $r{\_i}$, what is the explicit forms of asymptotics of $\Delta$$r\_i$, such as $\Delta$$r\_i$ $\propto$ $\frac{1}{r\_i}$ ? 


The problem can be also described as: 


What is the explicit forms of asymptotics of the minimum distance between two adjacent concentric circles that cross integer lattice points?


The motivation of this problem is that: integers $m$ and $n$ determine the electromagnetic resonance frequency $r$ in a 2-D rectangular cavity, so $\Delta$$r\_i$ is the distance between two adjacent resonance frequencies.


Thank you!



Minimum distance between adjacent concentric circles that cross integer lattice points
There cannot be an asymptotic answer, because $\Delta r\_i$ can be as small as $c/r\_i$ (with $c \rightarrow 1/2$ as $i \rightarrow \infty$), but $\Delta r\_i$ is of order $(\log r\_i)^{1/2} / r\_i$ on average. Equivalently, $\Delta(r\_i^2)$ can be as small as $1$ but is of order $\sqrt{\log r\_i}$ on average. One can also construct gaps of length $\gg \log r\_i / \log \log r\_i$.


Clearly $\Delta(r\_i^2)$ can be no smaller than $1$ because each $r\_i^2$ is an integer. A difference of $1$ is easily attained. The proposer of the question asked about positive $m,n$, but the application to eigenmodes of a 2-dimensional cavity — presumably a *square* cavity — must allow $m=0$ or $n=0$ as well, and then it's clear that $r\_i^2 = n^2 + 0^2$ and $r\_{i+1}^2 = n^2 + 1^2$ works. Even if you insist on nonzero $m,n$, differences of 1 are easy to construct; e.g. if $n^2 = a^2 + b^2$ then $r\_i^2 = a^2 + b^2$ and $r\_{i+1}^2 = n^2 + 1^2$ differ by 1.


On the other hand, while the number of solutions of $m^2 + n^2 \leq r\_0^2$ in positive $m,n$ is asymptotic to $\pi r\_0^2 / 4$ as $r\_0 \rightarrow \infty$, the set $R$ of possible $r$ values is not quite as dense as this suggests, because there's a lot of "degeneracy" (repetition) in the values of $m^2+n^2$; equivalently, as $x \rightarrow \infty$, the proportion of integers in $[1,x]$ that can be written as $m^2 + n^2$ goes to zero, so for those that *do* have such a representation the average number of representations must go to $\infty$. Indeed if $p$ is a prime congruent to $3 \bmod 4$ then no multiple of $p$ can be $m^2+n^2$ unless both $m$ and $n$ are multiples of $p$, which makes $m^2+n^2$ a multiple of $p^2$. This gives $p-1$ forbidden residues $\bmod p^2$. For any finite set $P$ of such primes, we deduce an upper bound $\beta\_P := \prod\_{p\in P} (1 - p^{-1} + p^{-2})$ on the density of integers representable as sums of two squares; since by Dirichlet the sum of $1/p$ over all such primes diverges, we find that $\log\beta\_P$ can be made arbitrarily negative by taking $P$ large enough, which means that the density is less than any positive number, and is thus zero. A more refined analysis shows that the density in $[1,x]$ decays as $1/\sqrt{\log x}$.


Another way to use a finite list $p\_1,\ldots,p\_k$ of primes congruent to $3 \bmod 4$ is to choose for each of them one of the forbidden residues, i.e. some $r(p\_i)$ that's divisible by $p\_i$ but not by $p\_i^2$, and consider the simultaneous congruences $N+i \equiv r(p\_i) \bmod p\_i^2$. By Chinese Remainder, there's a solution $N < \prod\_{i=1}^k p\_i^2$, which gives $k$ consecutive integers none of which is the sum of two squares. If we use all the $3 \bmod 4$ primes up to $x$, we get $k \sim x / 2 \log x$, and $\prod\_i p\_i^2 < x^{2k}$ so $\log \prod\_i p\_i^2 < 2k \log x \sim x$, whence we've constructed a "$\log/\log \log$" gap as claimed. There may be enough freedom in the choices we've made (including the order of the $p\_i$) to squeeze a bit more out of this argument, but — unless somebody can provide a reference for a paper that already proved such a result — it looks like more effort than one expects to exert on a MathOverflow question...


**EDIT** A quick Google search turned up a reference:



> 
> Heini Halberstam: Gaps in Integer Sequences, *Math. Magazine* **56** #3 (May 1983), 131-140
> 
> 
> 


The "$\log / \log\log$" bound (with the same Chinese Remainder) argument appears on page 136, followed by an asymptotic formula $A(x) \sim (\pi/\sqrt{12}) (x / \sqrt{\log x})$ for the number $A(x)$ of sums of two squares less than $x$. This formula is attributed to Landau 1908, though there's no paper of Landau in the bibliography. The bibliography does cite Iwaniec's "On the half-dimensional sieve" (*Acta Arith,* **29** (1976), 69-95) for an alternative approach, and also a two-page paper "On the gaps between numbers that are sums of two squares" by I.Richards in *Advances in Math.* **46** (1982), 1-2.


