OFFSET
1,1
COMMENTS
The primes appear in order, so a(n) is also the index of prime(n) in A376198.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..100000
PROG
(Python)
from itertools import count, islice
from sympy import isprime, nextprime
def agen(): # generator of terms
an, smc, smp = 2, 4, 3
for n in count(2):
if not isprime(an):
an = smp if an == 2*smp else smc
else:
yield n
an = smp if smp < smc else smc
if an == smp: smp = nextprime(smp)
else:
smc += 1
while isprime(smc): smc += 1
print(list(islice(agen(), 71))) # Michael S. Branicky, Oct 03 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Oct 03 2024
STATUS
approved