# Prime number sequences applying $x_{n+1}=2x\pm1$ based on $p \ mod \ 6$

Start with any prime number $$p$$.

If $$mod(p,6)=1$$ apply this: $$x_{n+1} = 2x_n-1$$

Otherwise $$mod(p,6)=5$$ and apply this: $$x_{n+1} = 2x_n+1$$

We then form a sequence starting with $$p$$ and if we continue this process indefinitely, $$mod(x,6)$$ stays the same, ergo if the starting prime is 1 below a multiple of 6, all numbers of the sequence will be 1 below a multiple of 6, the same applies for primes 1 above a multiple of 6. This can be proven algebraically.

The sequences look like this:

$$mod(p,6)=1 : 6n+1; 12n+1; 24n+1; 48n+1; ...$$

$$mod(p,6)=5 : 6n-1; 12n-1; 24n-1; 48n-1; ...$$

Can we guarantee that these sequences have infinitely many composite numbers in them (for all starting prime values)?

Or in another way: How do we prove, that we don't get stuck into a sequence of purely prime numbers?

• The exponential growth should guarantee infinite many composites , but I do not see a proof. Modulo-calculation with some integer $m\ge 2$ does not help since in the case $m\mid n$, every member of the sequences is coprime to $m$. Nov 20, 2021 at 17:27
• I object. The exponential growth per se has nothing to do with the number of composites. Nov 20, 2021 at 17:38
• @IvanNeretin Of course not , but this is an iterative process and we know none producing infinite many primes without a gap. I also have not claimed that this is a proof. Nov 20, 2021 at 17:42
• @Peter In that sense, I agree with you. Nov 20, 2021 at 17:43

Suppose $$p$$ is the starting prime of the form $$6n-1$$. Then the sequence goes as follows: $$p,\;2p+1,\;4p+3,\;\dots,2^kp+(2^k-1)\dots$$ As soon as $$2^k-1$$ is divisible by $$p$$ (which is going to happen at $$k=p-1$$ and multiples thereof, according to the Fermat's little theorem), the whole expression will also turn out divisible by $$p$$.