# Does alternating adding and multiplying primes in sequence produce only 2 prime numbers?

Define $a_1=2$ and

$$a_n = \left\{ \begin{array}{ll} p_na_{n-1}\quad\quad n\quad \text{odd}\\ p_n+a_{n-1}\quad n\quad \text{even}\\ \end{array} \right.$$

where $p_n$ is the nth prime number. The first few values are $2,5,25,32,352,365,\cdots$.

I've done some research and found that for $n<25$, this sequence produces only 2 primes in this range, $a_1=2$ and $a_2=5$. Is there a methodology for going about showing whether or not the sequence actually produces no more primes or not? I realize that $a_{4k-2}$ for $k\in\mathbb{N}$ are the only contenders since the others are either even and/or divisible by $p_i$. The numbers get very large, so it becomes difficult to check higher values of $n$.

Any thoughts appreciated. Thanks

• You've got the odd/even operation flipped. – Samuel Feb 24 '18 at 15:53
• Yes, but 2 is first. I'll add the first values to the question. – Samuel Feb 24 '18 at 15:57
• Those first few values suggest the sequence alternates even numbers with multiples of 5. You have already found values that break that pattern, right? – Robert Soupe Feb 24 '18 at 16:50
• Correct, that pattern doesn't continue. – Samuel Feb 24 '18 at 17:12

According to my calculation in PARI/GP $$a_{518}$$ is a probable prime with $792$ digits and $$a_{1226}$$ is a probable prime with $2143$ digits.