Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #26 Aug 15 2024 16:01:32
%S 2,4,9,19,10,19,18,37,22,43,32,65,131,42,83,54,109,60,119,237,473,945,
%T 1889,90,181,100,199,108,217,435,871,1743,3487,6975,13951,27903,55807,
%U 162,323,645,1289,182,365,731,1463,2927,210,419,228,457,232,463,242,485,971,262,523,272,545,1091,282
%N If a(n-1) is not a prime, then a(n) = 2*a(n-1) + S; otherwise set S = -S and a(n) = prime(n) + S; start with a(1) = 2, S = -1.
%C Similar to A373805, but with different initial values. Contains a repeated term (19), but that is allowed. Merges with A373805 at a(10) = 22. The primes here are therefore essentially the same as the primes in A373805: see A373806 and A373807.
%H N. J. A. Sloane, <a href="/A373808/b373808.txt">Table of n, a(n) for n = 1..5000</a>
%t Module[{n = 1, s = -1}, NestList[If[n++; PrimeQ[#], Prime[n] + (s = -s), 2*# + s] &, 2, 100]] (* _Paolo Xausa_, Aug 13 2024 *)
%Y Cf. A373805, A373806, A373807.
%K nonn
%O 1,1
%A _N. J. A. Sloane_, Aug 12 2024