Let $p_n$ denote the $n$th prime, starting from $p_0=2$. For each positive integer $i$, let $f(i)$ denote the least $n$ such that $p_{n+1}-p_n=2i$. So for instance, $f(1)=1$ (corresponding to $p_1=3$ and $p_2=5$), $f(2)=3$ (corresponding to $p_3=7$ and $p_4=11$), $f(3)=8$ (corresponding to $p_8=23$ and $p_9=29$), and $f(4)=23$ (corresponding to $p_{23}=89$ and $p_{24}=97$).
If there is no prime gap of size $2i$ (though it is conjectured that each even number is a prime gap infinitely often, see here), we omit $i$ from the sum below (or set $f(i)=\infty$ formally, which amounts to the same thing).
My question is:
Does the sum $$\sum_{i=0}^\infty \frac{1}{f(i)}=\frac{1}{1}+\frac{1}{3}+\frac{1}{8}+\frac{1}{23}\cdots$$ converge or diverge?
By the prime number theorem, $p_n= (1+o(1))n\log n$. This shows that $$ p_{n+1}-p_n = O(\log n) + o(n\log n) = o(n\log n) . $$ If we use a more accurate approximation of the same type, we can easily improve this to $$ p_{n+1}-p_n = o(n/\log^2 n) . $$ This implies that $f(k)\gtrsim k\log^2 k$, so the series converges.