login
A373808
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.
1
2, 4, 9, 19, 10, 19, 18, 37, 22, 43, 32, 65, 131, 42, 83, 54, 109, 60, 119, 237, 473, 945, 1889, 90, 181, 100, 199, 108, 217, 435, 871, 1743, 3487, 6975, 13951, 27903, 55807, 162, 323, 645, 1289, 182, 365, 731, 1463, 2927, 210, 419, 228, 457, 232, 463, 242, 485, 971, 262, 523, 272, 545, 1091, 282
OFFSET
1,1
COMMENTS
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.
LINKS
MATHEMATICA
Module[{n = 1, s = -1}, NestList[If[n++; PrimeQ[#], Prime[n] + (s = -s), 2*# + s] &, 2, 100]] (* Paolo Xausa, Aug 13 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Aug 12 2024
STATUS
approved