login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A373801 a(1) = 2; thereafter, if a(n-1) is prime then a(n) = prime(n) + 1; otherwise a(n) = 2*a(n-1) - 1. 3
2, 4, 7, 8, 15, 29, 18, 35, 69, 137, 32, 63, 125, 249, 497, 993, 1985, 3969, 7937, 72, 143, 285, 569, 90, 179, 102, 203, 405, 809, 114, 227, 132, 263, 140, 279, 557, 158, 315, 629, 1257, 2513, 5025, 10049, 20097, 40193, 200, 399, 797, 228, 455, 909, 1817, 3633, 7265, 14529, 29057, 58113, 116225 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Inspired by A374965. Just as the Riesel numbers (A101036 etc.) underlie A374965, so the Sierpinski numbers (A076336 etc.) underlie the present sequence. This means that for both A374965 and the present sequence, it is possible that there are only finitely many prime terms.
What is the next prime after a(1336) = 1486047139543908353?
The next prime in the sequence after a(1336) is the 328-digit prime a(2412) = 11027*2^1075 + 1 =
44637792944394283771459323765390022896709223538983902782431025499369487088325693\
80355294302151494343616855815219642969893790841894306289338825113522293047097809\
14527499539453353195318334412379318970183638103791974206651303944817277532365140\
54865648555402249863235603037071611259242935028448372668756790221309881865220759\
33966337. - Alois P. Heinz, Aug 05 2024
For a(1) prime, the trajectory converges to this sequence. Similar to A374965, the trajectories appear to converge to a few attractors. It appears that for most values of a(1), the trajectory converges to this sequences. For a(1) = 384 and 767, the trajectories traversed are different. - Chai Wah Wu, Aug 07 2024
LINKS
MAPLE
A:=Array(1..1200, 0);
t:=2;
A[1]:= t;
for n from 2 to 100 do
if isprime(t) then t:=ithprime(n)+1; else t:=2*t-1; fi;
A[n]:=t;
od:
[seq(A[n], n=1..100)];
MATHEMATICA
Module[{n = 1}, NestList[If[n++; PrimeQ[#], Prime[n] + 1, 2*# - 1] &, 2, 100]] (* Paolo Xausa, Aug 07 2024 *)
PROG
(Python)
from sympy import isprime, nextprime
def A373801_gen(): # generator of terms
a, p = 2, 3
while True:
yield a
a, p = p+1 if isprime(a) else (a<<1)-1, nextprime(p)
A373801_list = list(islice(A373801_gen(), 20)) # Chai Wah Wu, Aug 05 2024
CROSSREFS
For the primes in this sequence, see A373802 and A373803.
Sequence in context: A056694 A090606 A241548 * A019539 A327099 A338888
KEYWORD
nonn,new
AUTHOR
N. J. A. Sloane, Aug 05 2024
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 9 02:54 EDT 2024. Contains 375024 sequences. (Running on oeis4.)