I don't know whether this series converges: $$(\frac{1}{4} - \frac{1}{5}) + (\frac{1}{6} - \frac{1}{7}) + (\frac{1}{8} + \frac{1}{9} + \frac{1}{10} - \frac{3}{11}) + (\frac{1}{12} - \frac{1}{13}) + (\frac{1}{14} + \frac{1}{15} + \frac{1}{16} - \frac{3}{17}) + \dots$$ Can you explain it to me?
Definition of terms
If $n$ is composite you have $1/n$ and if $n$ is prime you have $−(n−m−1)/n$ where $m$ is the previous prime.
Details
Actually I got the series from the equalities: $$\log(n)=\sum_{i=1}^m \frac{p_i-p_{i-1}} {p_i}+\epsilon_n,$$ $p_i$ denotes prime number from $1$ to $n$, $p_0$ is $1$ and $p_m$ is $n$ and
$$\sum_{i=1}^n \frac{1} {i}=\log\left(n\right)+\gamma+\delta_n.$$
Obviously $\epsilon_n$ becomes larger and larger when $n$ increases, but it increases very slowly. The value is $0.706540\ldots$, gotten by computer. What I want to know is whether $\epsilon_n$ has a upper boundary.
(Now a full solution, thanks to @GregMartin, see the end of the answer.)
Let $(p_n)_{n\geqslant1}$ denote the sequence of prime numbers, hence $p_1=2$, $p_2=3$, $p_3=5$, and so on, and let $g_n=p_{n+1}-p_n$ the $n$th prime number gap. From the exchanges in comments, it seems that the question asks about the convergence of the series $$A=\sum_{i\geqslant4}\frac{a(i)}i,\quad a(p_n)=1-g_{n-1}\ (n\geqslant3),\quad a(i)=1\ (i\ \text{not prime}).$$ The fact that $g_n\ll p_n$ implies that the oscillations of the partial sums of $A$ converge to zero hence the convergence of $A$ is equivalent to the convergence of the series with positive terms $$\sum\limits_{n\geqslant2}s(p_n,g_n),$$ where the functional $s$ is defined on every pair $(p,g)$ of positive integers by $$s(p,g)=\sum_{i=1}^{g}\left(\frac1{p+i}-\frac1{p+g}\right).$$ Note that, for every positive $p$ and $g$, $$s(p,g)\leqslant\sum_{i=1}^{g}\left(\frac1{p}-\frac1{p+g}\right)=\frac{g^2}{p(p+g)}\leqslant\frac{g^2}{p^2}.$$ Likewise, $$s(p,g)\geqslant\sum_{i=1}^{g/2}\frac1{p+g/2}-\frac1{p+g}=\frac{g^2}{4(p+g/2)(p+g)}\geqslant\frac{g^2}{4(p+g)^2},$$ hence the convergence of $A$ is equivalent to the convergence of $S_2$, where, for every $\alpha$, $$S_\alpha=\sum_n\left(\frac{g_n}{p_n}\right)^\alpha.$$ Thanks to @GregMartin, one knows that the series $S_\alpha$ converges for every $\alpha\gt1$, in particular $S_2$ converges. This proves that the series $A$ converges.