OFFSET
1,2
COMMENTS
The composite terms appear in their natural order, as do the primes.
This is a simplified version of A375564 (the difference being in the way the composite numbers are handled: here they appear in order, whereas in A375564 successive composite numbers must have a common gcd greater than 1).
The following table was calculated by Michael S. Branicky on Oct 04 2024.
It shows the beginning, end, and length of the k-th run of successive primes.
2 9 5 : 11 11 3
3 23 13 : 26 23 4
4 52 29 : 59 59 8
5 110 61 : 122 113 13
6 231 127 : 254 251 24
7 472 257 : 514 509 43
8 965 521 : 1042 1039 78
9 1958 1049 : 2099 2099 142
10 3962 2111 : 4222 4219 261
11 7980 4229 : 8458 8447 479
12 16029 8461 : 16922 16921 894
13 32181 16927 : 33854 33851 1674
14 64597 33857 : 67714 67709 3118
15 129574 67723 : 135446 135433 5873
16 259798 135449 : 270899 270899 11102
17 520835 270913 : 541826 541817 20992
18 1043833 541831 : 1083662 1083659 39830
19 2091473 1083689 : 2167378 2167369 75906
20 4190135 2167393 : 4334786 4334777 144652
21 8392863 4334791 : 8669582 8669543 276720
22 16809322 8669593 : 17339186 17339177 529865
23 33661860 17339197 : 34678394 34678381 1016535
24 67402676 34678421 : 69356842 69356839 1954167
25 134952624 69356857 : 138713714 138713711 3761091
26 270177158 138713717 : 277427434 277427431 7250277
27 540861852 277427441 : 554854882 554854873 13993031
28 1082667610 554854889 : 1109709778 1109709709 27042169
29 2167106199 1109709791 : 2219419582 2219419577 52313384
30 4337519113 2219419597 : 4438839194 4438839173 101320082
31 8681255531 4438839259 : 8877678518 8877678499 196422988
32 17374202846 8877678527 : 17755357054 17755357051 381154209
33 34770433922 17755357069 : 35510714138 35510714137 740280217
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..100000
PROG
(Python)
from itertools import islice
from sympy import isprime, nextprime
def agen(): # generator of terms
an, smc, smp = 2, 4, 3
yield from [1, 2]
while True:
if not isprime(an):
an = smp if an == 2*smp else smc
else:
an = smp if smp < smc else smc
if an == smp: smp = nextprime(smp)
else:
smc += 1
while isprime(smc): smc += 1
yield an
print(list(islice(agen(), 87))) # Michael S. Branicky, Oct 03 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Oct 03 2024
STATUS
approved