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 A354731 #15 Jun 04 2022 13:28:25 %S A354731 1,3,2,4,5,7,15,9,8,13,17,19,11,6,12,14,20,10,29,21,16,22,23,27,25,31, %T A354731 18,47,35,33,37,26,61,39,34,28,24,55,43,41,45,38,40,30,32,44,89,59,57, %U A354731 49,53,65,58,51,63,115,67,56,46,36,91,71,69,73,62,48,42,99,77,50,125,79,75,83,85,81 %N A354731 Absolute values of first differences of A354688. %C A354731 See A354688 for further details. %H A354731 Michael De Vlieger, <a href="/A354731/a354731_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 A354731 Scott R. Shannon, <a href="/A354731/a354731.png">Image of the first 10000</a>. The green line is y = n. %e A354731 a(3) = 2 as | A354688(4) - A354688(3) | = | 3 - 5 | = 2. %t A354731 nn = 120; c[_] = d[_] = 0; a[1] = c[1] = 1; a[2] = c[2] = j = 2; u = 3; {1}~Join~Reap[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}]; Sow[Abs[k - j]]; j = k; If[k == u, While[c[u] > 0, u++]], {i, 3, nn}]][[-1, -1]] (* _Michael De Vlieger_, Jun 04 2022 *) %o A354731 (Python) %o A354731 from math import gcd %o A354731 from sympy import isprime, nextprime %o A354731 from itertools import count, islice %o A354731 def agen(): # generator of terms %o A354731 aset, diffset, an, mink = {1}, set(), 1, 2 %o A354731 for n in count(2): %o A354731 k = mink %o A354731 while k in aset or abs(an-k) in diffset or gcd(an, k) != 1: k += 1 %o A354731 aset.add(k); diffset.add(abs(k-an)); yield abs(k-an); an = k %o A354731 while mink in aset: mink += 1 %o A354731 print(list(islice(agen(), 76))) # _Michael S. Branicky_, Jun 04 2022 %Y A354731 Cf. A354688, A352588, A093714, A354687, A354721. %K A354731 nonn %O A354731 1,2 %A A354731 _Scott R. Shannon_, Jun 04 2022