This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A373999 #12 Jun 24 2024 10:58:25 %S A373999 1,2,3,5,7,4,9,25,49,8,27,55,91,16,51,11,13,10,17,21,121,20,169,57,77, %T A373999 32,65,19,33,14,85,247,69,22,35,221,23,6,95,119,143,12,115,133,187,18, %U A373999 125,161,209,24,145,217,253,26,15,29,31,28,39,185,289,38,63,37,155,34,81,203,205,44 %N A373999 a(1) = 1, a(2) = 2, a(3) = 3, a(4) = 5, a(5) = 7; for n > 5, a(n) is the smallest unused positive number that is coprime to a(n-1), a(n-2) and a(n-3) but has a common factor with at least one of a(1)...a(n-4). %C A373999 Initially the terms agree with the observation noted in A373998 and are concentrated predominantly along five lines of different gradient, with the primes forming the lowermost line. However this pattern is disrupted by the second lowest line showing a repetitive discontinuous jump to lower values which also interrupts the third middle line. An examination of the terms shows this is due to the appearance of three consecutive terms which are not divisible by 2 or 3. This allows subsequent terms to be a low multiple of 2 and 3, forming numbers which are less than the most recently appearing prime values. Also of note is after approximately 85000 terms the upper two lines merge; it is assumed that the remaining four lines continue in the above pattern as n grows arbitrarily large, although this is unknown. %C A373999 Other than the first three terms the fixed points in the first 100000 terms are 35, 63, 219, 231, 1407, 2967, 3003, 6555, 14007, 14031, 32103, 77343, although it is likely 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. %H A373999 Scott R. Shannon, <a href="/A373999/b373999.txt">Table of n, a(n) for n = 1..10000</a> %H A373999 Scott R. Shannon, <a href="/A373999/a373999_1.png">Image of the first 100000 terms</a>. 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. %e A373999 a(9) = 49 as 49 is the smallest unused number that is coprime to a(6) = 4, a(7) = 9, and a(8) = 25, while sharing a factor with a(5) = 7. %o A373999 (Python) %o A373999 from math import gcd, lcm %o A373999 from itertools import count, islice %o A373999 def agen(): # generator of terms %o A373999 alst = [1, 2, 3, 5, 7] %o A373999 yield from alst %o A373999 aset, LCM, mink = set(alst), lcm(*alst[:-3]), 4 %o A373999 while True: %o A373999 an = next(k for k in count(mink) if k not in aset and all(1 == gcd(k, m) for m in alst[-3:]) and gcd(k, LCM) > 1) %o A373999 LCM = lcm(LCM, alst[-3]) %o A373999 alst.append(an) %o A373999 aset.add(an) %o A373999 while mink in aset: mink += 1 %o A373999 yield an %o A373999 print(list(islice(agen(), 70))) # _Michael S. Branicky_, Jun 24 2024 %Y A373999 Cf. A373998, A373390, A089088, A064413, A098550, A373880. %K A373999 nonn %O A373999 1,2 %A A373999 _Scott R. Shannon_, Jun 24 2024