This is a prime-removal algorithm I made, which may appear to be quite complex so I will start with an example. @Max has since added this sequence to OEIS, number A332198.
The process goes as follows:
Start with the first prime number, $$S(1)=2.$$
From $2$, add the next prime number $3$ to get $$S(2)=2+3=5.$$ There are no non-trivial factors, so we move on.
From $2+3$, add the next prime number $5$ to get $$S(3)=2+3+5=10.$$ Since $10=2\times5$ and these two numbers appear in the sum, we remove $2$ and $5$.
We are left with $3$.From $3$, add the next prime number $5$ to get $$S(4)=3+5=8.$$ Now $8=2\times2\times2$, but $2$ does not appear in the sum, so we move on.
From $3+5$, add the next prime number $7$ to get $$S(5)=3+5+7=15.$$ Since $15=3\times5$ and these two numbers appear in the sum, we remove $3$ and $5$.
We are left with $7$.(and so on)
So essentially, we keep on adding consecutive prime numbers until we reach a sum whose prime factorisation contains some of those primes. We remove those primes and start the process once again. Great, except...
There is one more rule that needs to be added. If we continue doing this, we soon find ourselves in a rather strange scenario.
(and so on) a continuation:
From $37+47+59+\cdots+241+251+257$, add the next prime number $263$ to get $$S(57)=37+47+59+\cdots+251+257+263=5918.$$ Now $5918=2\times11\times269$, but neither of the three primes appear in the sum, so we move on.
From $37+47+59+\cdots+251+257+263$, add the next prime number $269$ to get $$S(58)=37+47+59+\cdots+251+257+263+269=6187.$$ Since $6187=23\times269$ and $269$ appears in the sum, we remove $269$.
We are left with $37+47+59+\cdots+251+257+263$.
This is a cycle! The sequence of $263$ and $269$ will continue forever, if we don't add another rule to this process. Therefore, I call $269$ a cyclic prime, and I propose this new rule.
- From $37+47+59+\cdots+251+257+263$, add the next non-cyclic prime number $271$ to get $$S(59)=37+47+59+\cdots+251+257+263+271=6189.$$ Now $6189=2\times2063$ and these two numbers do not appear in the sum, so we move on.
I do not know whether there are any dicyclic primes; that is, primes that are still cyclic after more than one iteration.
Questions
- Will every prime number in the sum eventually be removed? If not, which prime numbers will remain in the sum forever?
It appears to be true. From this Python program by @EuxhenH, we see that all primes up to $16903$ are eliminated at some point before overflow. The table linked shows how long it takes ($N$ iterations) for the smallest prime $P$ in the sum to be removed. It appears that $P$ increases as $N$ increases despite significant fluctuation.
Follow-up: What is the asymptotic growth of $N(P)$? For instance, does it admit a $\log$ or $\log\log$ increase?
Are there infinitely many cyclic prime numbers?
As of writing, the only known cyclic prime numbers are $269$ and $94793$.
Using @Max's PARI/GP program, I plotted $S(n)$ for $n\le575$
which should grow like $Cx^a\log^bx$.
Note that this sequence, by definition, is bounded above by $$\sum_{i\le n}p_i\sim\frac12n^2\log n.$$ Indeed, when $a=2$ and $b=1$, Mathematica gives an optimal value of $C\approx0.4716$. However, the residual plot suggests there is perhaps a better asymptotic.