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 A381115 #16 Feb 15 2025 14:11:57 %S A381115 4,9,8,6,25,12,10,49,15,16,14,27,20,21,22,18,35,24,169,28,33,26,85,32, %T A381115 57,77,30,34,39,55,38,51,40,91,36,121,42,65,44,45,529,48,119,46,95,81, %U A381115 143,50,63,52,54,115,56,841,187,69,62,125,87,64,133,75,58,221 %N A381115 Composite terms in A381019 in order of appearance. %H A381115 Michael S. Branicky, <a href="/A381115/b381115.txt">Table of n, a(n) for n = 1..336</a> %t A381115 nn = 500; c[_] = False; u = v = 2; a[1] = 1; %t A381115 Monitor[Reap[ %t A381115 Do[k = u; %t A381115 While[Or[c[k], %t A381115 ! CoprimeQ[k, Product[a[h], {h, n - Min[k, n - 1], n - 1}] ] ], %t A381115 If[k > n - 1, k = v, k++]]; %t A381115 Set[{a[n], c[k]}, {k, True}]; %t A381115 If[CompositeQ[k], Sow[k]]; %t A381115 If[k == u, While[c[u], u++]]; %t A381115 If[k == v, While[Or[c[v], CompositeQ[v]], v++]], {n, 2, nn}] ][[-1, 1]], n] (* _Michael De Vlieger_, Feb 14 2025 *) %o A381115 (Python) %o A381115 from math import gcd %o A381115 from sympy import isprime %o A381115 from itertools import count, islice %o A381115 def agen(): # generator of terms %o A381115 alst, aset, an, m = [1], {1}, 1, 2 %o A381115 for n in count(2): %o A381115 if an > 3 and not isprime(an): %o A381115 yield an %o A381115 an = next(k for k in count(m) if k not in aset and all(gcd(alst[-j], k) == 1 for j in range(1, min(k, n-1)+1))) %o A381115 alst.append(an) %o A381115 aset.add(an) %o A381115 while m in aset: m += 1 %o A381115 print(list(islice(agen(), 64))) # _Michael S. Branicky_, Feb 14 2025 %Y A381115 Cf. A381019, A381116, A381117. %K A381115 nonn %O A381115 1,1 %A A381115 _N. J. A. Sloane_, Feb 14 2025