OFFSET
1,2
COMMENTS
For the terms studied, and similar to A373390 and A089088, the terms are concentrated along distinct lines of different gradient, four in this sequence, and like those sequences, the lowermost line is composed only of primes.
Note that in A089088, A373390, and this sequence, a(n) is coprime to zero, one and two previous terms, and the corresponding sequence terms are concentrated along two, three and four lines respectively.
The fixed points are 1, 2, 3, 8, 45, 51, and it is likely no more exist. For the terms studied the primes appear in their natural order. The sequence is conjectured to be a permutation of the positive integers.
LINKS
Scott R. Shannon, Table of n, a(n) for n = 1..10000
Scott R. Shannon, Image of the first 50000 terms. Numbers with one, two, three, four, or five and more prime factors, counted with multiplicity, are show as red, yellow, green, blue and violet respectively.
EXAMPLE
a(7) = 25 as 25 is the smallest unused number that is coprime to a(5) = 4 and a(6) = 9 while sharing a factor with a(4) = 5.
PROG
(Python)
from math import gcd, lcm
from itertools import count, islice
def agen(): # generator of terms
alst = [1, 2, 3, 5]
yield from alst
aset, LCM, mink = set(alst), lcm(*alst[:-2]), 4
while True:
an = next(k for k in count(mink) if k not in aset and 1 == gcd(k, alst[-1]) == gcd(k, alst[-2]) and gcd(k, LCM) > 1)
LCM = lcm(LCM, alst[-2])
alst.append(an)
aset.add(an)
while mink in aset: mink += 1
yield an
print(list(islice(agen(), 72))) # Michael S. Branicky, Jun 24 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Jun 24 2024
STATUS
approved