An old question in number theory is the behaviour of gaps between numbers which are sums of two squares. It is know that the gap between consecutive sums of two squares, say $s, s'$, is at most $O(s^{1/4})$. It is expected that for any $\varepsilon > 0$, the gap is at most $O_\varepsilon(s^{\varepsilon})$.

We note that, up to square factors, sums of two squares are numbers which are only divisible by primes congruent to 1 modulo 4 and the prime 2. Therefore a natural extension of this question is the following:

Let $\mathcal{P}$ be a subset of the prime numbers, such that $\mathcal{P}$ has positive natural density in the primes. Let $S'(\mathcal{P})$ be the set of natural numbers $n$ such that $p | n$ if and only if $p \in \mathcal{P}$, and let $S(\mathcal{P})$ be the set of numbers which are square multiples of elements in $S'(\mathcal{P})$. Write

$$\displaystyle S(\mathcal{P}) = \{s_1 < s_2 < s_3 < \cdots \}.$$

What can be said about the gaps $s_{n+1} - s_n$?

Natural examples of $\mathcal{P}$ are primes defined by congruence conditions (say, primes which are $5 \pmod{6}$) or defined by splitting behaviour in a given number field. For example, we can define $\mathcal{P}$ to be the set of primes which split completely over some finite extension $K/\mathbb{Q}$.