OFFSET
1,2
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, adict, n = 2, 4, 3, {1: 1, 2: 2}, 1
for k in count(3):
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
if an not in adict: adict[an] = k
while n in adict: yield adict[n]; n += 1
print(list(islice(agen(), 85))) # Michael S. Branicky, Oct 03 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Oct 03 2024
STATUS
approved
