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 A354687 #23 Jun 04 2022 13:04:11 %S A354687 1,2,4,8,14,6,3,12,22,10,5,20,34,16,32,52,13,26,48,15,36,9,33,44,18, %T A354687 46,23,69,21,28,58,24,56,7,42,78,27,72,30,55,11,66,104,38,19,76,116, %U A354687 29,87,141,39,91,35,85,17,102,40,100,25,90,153,45,114,50,120,192,51,68,142,54,130,208,60 %N A354687 a(1) = 1; for n > 1, a(n) is the smallest positive number that has not yet appeared that shares a factor with a(n-1) and the difference | a(n) - a(n-1) | is distinct from all previous differences. %C A354687 The terms are concentrated along many different lines, although three lines contain a higher concentration of terms than the others; these are similar to the three lines seen in A064413. See the linked image. The primes do not occur in their natural order, and unlike A064413, the terms proceeding and following a prime term can be high multiples of the prime. %C A354687 In the first 200000 terms the fixed points are 1,2,6,10,68. It is plausible no more exist although this is unknown. The sequence is conjectured to be a permutation of the positive integers. %C A354687 See A354721 for the differences between terms. %H A354687 Michael De Vlieger, <a href="/A354687/b354687.txt">Table of n, a(n) for n = 1..10000</a> %H A354687 Michael De Vlieger, <a href="/A354687/a354687_1.png">Annotated log log scatterplot of a(n)</a>, n = 1..2^14, showing records in red and local minima in blue, highlighting primes in green and fixed points in gold. %H A354687 Scott R. Shannon, <a href="/A354687/a354687.png">Image of the first 100000 terms</a>. The green line is y = n. %e A354687 a(4) = 8 as a(3) = 4, and 8 is the smallest unused number that shares a factor with 4 and whose difference from the previous term,| 8 - 4 | = 4, has not appeared. Note 6 shares a factor with 4 but | 6 - 4 | = 2, and a difference of 2 has already occurred between as | a(3) - a(2) |, so 6 cannot be chosen. %t A354687 nn = 120; c[_] = d[_] = 0; a[1] = c[1] = 1; a[2] = c[2] = j = 2; u = 3; Do[Set[k, u]; While[Nand[c[k] == 0, d[Abs[k - j]] == 0, ! CoprimeQ[j, k]], k++]; Set[{a[i], c[k], d[Abs[k - j]]}, {k, i, i}]; j = k; If[k == u, While[c[u] > 0, u++]], {i, 3, nn}]; Array[a, nn] (* _Michael De Vlieger_, Jun 04 2022 *) %o A354687 (Python) %o A354687 from math import gcd %o A354687 from sympy import isprime, nextprime %o A354687 from itertools import count, islice %o A354687 def agen(): # generator of terms %o A354687 aset, diffset, an, mink = {1, 2}, {1}, 2, 3 %o A354687 yield from [1, 2] %o A354687 for n in count(3): %o A354687 k = mink %o A354687 while k in aset or abs(an-k) in diffset or gcd(an, k) == 1: k += 1 %o A354687 aset.add(k); diffset.add(abs(k-an)); an = k; yield an %o A354687 while mink in aset: mink += 1 %o A354687 print(list(islice(agen(), 73))) # _Michael S. Branicky_, Jun 04 2022 %Y A354687 Cf. A354721, A064413, A354688, A354731, A354087, A352763. %K A354687 nonn %O A354687 1,2 %A A354687 _Scott R. Shannon_, Jun 03 2022