Abstract:
Suppose that $E_1$, $E_2$ are arbitrary subsets of the set of primes and $g_1(n)$, $g_2(n)$ are additive functions taking integer values such that $g_i(p)=1$, if $p\in E_i$ and $g_i(p)=0$ otherwise, $i=1,2$. Set
$$
E_i(x)=\sum_{\substack{p\le x,\\p\in E_i}}\frac 1p,\quad i=1,2.
$$
It is proved in this paper that if $R(x)=\max(E_1(x),E_2(x))$, $a\ne0$ is an integer, then $$
\sup_m|\{n:n\le x, g_2(n+a)-g_1(n)=m\}|
\ll\frac x{\sqrt{R(x)}}.
$$
If, moreover, $E_i(x)\ge T$ for $x\ge x_0$, where $T$ is a sufficiently large constant and
$$
|m-(E_2(x)-E_1(x))|\le\mu\sqrt{R(x)},
$$
then there exists a constant $c(\mu,a,T)>0$ such that for $x\ge x_0$ we have
$$
\sum_{i=0}^3|\{n:n\le x,g_2(n+a)-g_1(n)=m+i\}|\ge c(\mu,a,T)\frac x{\sqrt{R(x)}}.
$$