OFFSET
1,2
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
MATHEMATICA
nn = 120; c[_] = 0; a[1] = c[1] = 1; u = 2; {1}~Join~Reap[Do[k = u; While[Nand[c[k] == 0, CoprimeQ[#, k], k != # + 1], k++] &@ a[i - 1]; Set[{a[i], c[k]}, {k, i}]; If[a[i] == u, While[c[u] > 0, u++]], {i, 2, nn}]][[-1, -1]] (* Michael De Vlieger, May 02 2022 *)
PROG
(Python)
from math import gcd
from itertools import islice
def agen(): # generator of terms
an, aset, mink = 1, {1}, 2
yield 1
while True:
yield mink
k = mink
while k in aset or gcd(an, k) != 1 or k-an == 1: k += 1
an = k
aset.add(an)
while mink in aset: mink += 1
print(list(islice(agen(), 72))) # Michael S. Branicky, May 02 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 02 2022
STATUS
approved
