Denote $A$ $-$ set of positive numbers with only prime factors of the form $4k+1$ and
$B$ $-$ set of positive numbers that can be represented as sum of two squares. $A$ is a subset of $B$ and [there is](https://math.stackexchange.com/questions/2376879/does-the-interval-x-x-10-x1-4-contain-a-sum-of-two-squares) upper bound $2 \sqrt{2} n^{\frac{1}{4}}$ for maximal gap between consecutive elements of $B$.


**Question:** Is any upper bound for maximal gap between consecutive elements of $A$ known?



Upper bound for maximal gap between consecutive numbers consisting only $4k+1$ primes
One can prove a bound comparable to the $O(n^{1/4})$ bound for $B$. To derive it, notice that any odd number of the form $a^2+b^2$ with $(a,b)=1$ lies in $A$. Now, for a given large number $N$, choose the largest even $a$ such that $a^2<N$. Then, of course $N-a^2=O(\sqrt{N})$. We now want to choose $b$ coprime to $a$ such that $N-a^2-b^2$ is small. Let $j(a)$ be the Jacobsthal function of $a$, i.e. the smallest $j$ such that any set of $j$ consecutive integers contains a number coprime to $a$. Consider the numbers $[\sqrt{N-a^2}], [\sqrt{N-a^2}]-1,\ldots, [\sqrt{N-a^2}]-j+1$. One of them is coprime to $a$, denote it by $b$. Then we get
$$
N-a^2-b^2\ll j(a)\sqrt{N-a^2}+j(a)^2.
$$
Next, by the result of [Iwaniec (1978)](https://doi.org/10.1515/dema-1978-0121), $j(a)\ll \ln^2 a$, so we proved that the size of gaps in $A\cap [1,n]$ is at most $O(n^{1/4}\ln^2 n)$.


