OFFSET
1,2
COMMENTS
Conjectures: the terms consist of runs of an even number (>1) of successive numbers that increase by 1 at each step; A376758(n) is one-half of the length of the n-th such run; and the run ends at A376751(n) - 1. - N. J. A. Sloane, Oct 07 2024
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..398
PROG
(Python)
from itertools import count, islice
from sympy import isprime, nextprime
def agen(): # generator of terms
an, smc, smp = 2, 4, 3
yield from [1, 2]
for n 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 n == an: yield an
print(list(islice(agen(), 59))) # Michael S. Branicky, Oct 03 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Oct 03 2024
STATUS
approved