# Alternating series of primes

Consider the infinite alternating series: $$2-3+5-7+11-13+17...$$ taken over all primes. Partial sums at odd terms gives: $$2-3+5=2^2\\ 2-3+5-7+11=2^3\\ 2-3+5-7+11-13+\dotsb+23=2^4\\ \vdots$$ Is there a proof that there are infinite partial sums that give as a result a number of the form $$2^{k}$$?

• Interesting discovery... Feb 15, 2018 at 20:39
• Are some powers of 2 missing in the sequence?
– user
Feb 15, 2018 at 20:52
• Some insights are available on A008347 from OEIS.
– John
Feb 15, 2018 at 21:17
• There's a conjecture that $512$ is the largest power of two for some number of terms in the series, but not a proof.
– John
Feb 15, 2018 at 21:22
• I checked for the first $5\cdot 10^7$ primes and did not find a power of two bigger than $512$.
– orlp
Feb 15, 2018 at 21:57

Effectively you are accumulating alternate prime gaps. $2+(5-3) + (11-7)+(17-13)+ \cdots$. The downstep values are irrelevant because they are odd. The alternating even values are monotonically increasing.

Prime gaps are fairly small compared to the primes themselves but are very difficult to put strict limits on analytically. I would not be surprised to continue to find occasional hits on powers of two indefinitely, but they evidently become rarer.

Tabulating the results for primes out to $500$ million for the increasing power of two, the prime $p_k$ where the series reaches that value and the actual series value $S_k$ at that point:

\begin{array}{|c|c|} \text{power of $2$} & p_k & S_k & \text{hit?} \\ \hline 2 & 2 & 2 & \checkmark \\ 4 & 5 & 4 & \checkmark \\ 8 & 11 & 8 & \checkmark \\ 16 & 23 & 16 & \checkmark \\ 32 & 59 & 32 & \checkmark \\ 64 & 127 & 70 & \times \\ 128 & 211 & 128 & \checkmark \\ 256 & 449 & 258 & \times \\ 512 & 977 & 512 & \checkmark \\ 1024 & 2087 & 1026 & \times \\ 2048 & 4091 & 2052 & \times \\ 4096 & 8329 & 4104 & \times \\ 8192 & 16649 & 8194 & \times \\ 16384 & 33107 & 16386 & \times \\ 32768 & 64997 & 32788 & \times \\ 65536 & 131009 & 65556 & \times \\ 131072 & 264949 & 131084 & \times \\ 262144 & 525359 & 262148 & \times \\ 524288 & 1051747 & 524306 & \times \\ 1048576 & 2107319 & 1048594 & \times \\ 2097152 & 4204223 & 2097198 & \times \\ 4194304 & 8408747 & 4194312 & \times \\ 8388608 & 16780681 & 8388614 & \times \\ 16777216 & 33563741 & 16777218 & \times \\ 33554432 & 67113811 & 33554438 & \times \\ 67108864 & 134255887 & 67108866 & \times \\ 134217728 & 268466503 & 134217778 & \times \\ \end{array}

• Why is $p_k\approx S_k\times 2$? Apr 3, 2018 at 8:46
• Proof by induction? Inductive step: suppose $S_{k-1}\approx-p_{k-1}/2$. Then $S_k=S_{k-1}+p_k\approx-p_{k-1}/2+p_k\approx-p_k/2+p_k=p_k/2$. Apr 3, 2018 at 9:14
• @ZiruiWang I'd say that's because you're only adding every other prime gap, not every prime gap. Apr 3, 2018 at 11:51
• $S_k$ seems to always be near a power of $2$. Why? May 26, 2018 at 8:53
• @user477343 that's how the $k$ is being chosen in each case, the value that takes $S_k$ to or past the next power of $2$. May 27, 2018 at 4:01