This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A373801 #43 Oct 21 2024 00:04:57 %S A373801 2,4,7,8,15,29,18,35,69,137,32,63,125,249,497,993,1985,3969,7937,72, %T A373801 143,285,569,90,179,102,203,405,809,114,227,132,263,140,279,557,158, %U A373801 315,629,1257,2513,5025,10049,20097,40193,200,399,797,228,455,909,1817,3633,7265,14529,29057,58113,116225 %N 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. %C A373801 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. %C A373801 What is the next prime after a(1336) = 1486047139543908353? %C A373801 The next prime in the sequence after a(1336) is the 328-digit prime a(2412) = 11027*2^1075 + 1 = %C A373801 44637792944394283771459323765390022896709223538983902782431025499369487088325693\ %C A373801 80355294302151494343616855815219642969893790841894306289338825113522293047097809\ %C A373801 14527499539453353195318334412379318970183638103791974206651303944817277532365140\ %C A373801 54865648555402249863235603037071611259242935028448372668756790221309881865220759\ %C A373801 33966337. - _Alois P. Heinz_, Aug 05 2024 %C A373801 For a(1) any prime, the trajectory converges to this sequence. Just as in A374965, the trajectories appear to converge to a few attractors. In fact it appears that for most values of a(1), the trajectory converges to the present sequence. However, for a(1) = 384 and 767 the trajectories are different. - _Chai Wah Wu_, Aug 07 2024 %H A373801 N. J. A. Sloane, <a href="/A373801/b373801.txt">Table of n, a(n) for n = 1..2000</a> %H A373801 N. J. A. Sloane, <a href="https://www.youtube.com/watch?v=3RAYoaKMckM">A Nasty Surprise in a Sequence and Other OEIS Stories</a>, Experimental Mathematics Seminar, Rutgers University, Oct 10 2024, Youtube video; <a href="https://sites.math.rutgers.edu/~zeilberg/expmath/sloane85BD.pdf">Slides</a> [Mentions this sequence] %p A373801 A:=Array(1..1200,0); %p A373801 t:=2; %p A373801 A[1]:= t; %p A373801 for n from 2 to 100 do %p A373801 if isprime(t) then t:=ithprime(n)+1; else t:=2*t-1; fi; %p A373801 A[n]:=t; %p A373801 od: %p A373801 [seq(A[n],n=1..100)]; %t A373801 Module[{n = 1}, NestList[If[n++; PrimeQ[#], Prime[n] + 1, 2*# - 1] &, 2, 100]] (* _Paolo Xausa_, Aug 07 2024 *) %o A373801 (Python) %o A373801 from sympy import isprime, nextprime %o A373801 def A373801_gen(): # generator of terms %o A373801 a, p = 2, 3 %o A373801 while True: %o A373801 yield a %o A373801 a, p = p+1 if isprime(a) else (a<<1)-1, nextprime(p) %o A373801 A373801_list = list(islice(A373801_gen(),20)) # _Chai Wah Wu_, Aug 05 2024 %Y A373801 Cf. A374965, A076336, A101036. %Y A373801 For the primes in this sequence, see A373802 and A373803. %K A373801 nonn %O A373801 1,1 %A A373801 _N. J. A. Sloane_, Aug 05 2024