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 A354732 #24 Jul 01 2025 23:33:47 %S A354732 1,2,3,4,5,8,7,6,11,9,13,12,17,10,19,14,23,16,15,21,29,22,20,27,31,25, %T A354732 18,24,37,35,26,32,33,41,28,34,39,43,38,40,47,49,30,36,53,59,42,44,61, %U A354732 65,45,46,67,51,50,52,71,57,56,58,55,69,62,63,73,64,68,75,77 %N A354732 Lexicographically earliest infinite sequence of distinct positive integers such that in any run of four consecutive terms there is only one pair of terms which share a prime divisor, the rest are all pairwise coprime. %C A354732 Can be regarded as the reverse of A354717, which has the opposite coprime relations to those defined here. Primes tend to be records but not all records are primes (8, 16 are nonprime records; 11,13 are primes but not records). %C A354732 Conjecture: Sequence is a permutation of the positive integers in which the primes appear in their natural order. %H A354732 Michael De Vlieger, <a href="/A354732/b354732.txt">Table of n, a(n) for n = 1..10000</a> %H A354732 David A. Corneth, <a href="/A354732/a354732.gp.txt">PARI program</a> %H A354732 Michael De Vlieger, <a href="/A354732/a354732.png">Annotated scatterplot of a(n)</a>, n = 1..128 showing primes in red, odd composites in gold, and even numbers in blue, labeling a(n) such that n corresponds to first differences d in the indices of smallest missing numbers that meet or exceed record differences. %H A354732 Michael De Vlieger, <a href="/A354732/a354732_1.png">Scatterplot of a(n)</a>, n = 1..2048 showing primes in red, odd composites in gold, and even numbers in blue, labeling a(n) such that n corresponds to first differences d in the indices of smallest missing numbers that meet or exceed record differences. %e A354732 a(1,2,3,4) = 1,2,3,4 is the lexicographically earliest string of four consecutive terms which satisfy the definition, hence sequence starts with these terms. %e A354732 a(12,13,14) = 10,17,6 respectively, and 19 is the smallest term not already seen in the sequence such that 10,17,6,19 satisfy the definition ((10,6)=2, and (10,17)=(10,19)=(17,19)=(17,6)=(6,19)=1); therefore a(15)=19. %t A354732 Block[{a, c, k, len, u, nn}, nn = 120; c[_] = 0; len = 3; Array[Set[{a[#], c[#]}, {#, #}] &, len + 1]; u = 5; Do[k = u; While[Nand[c[k] == 0, Or[MemberQ[#, 2], MemberQ[#, 3]] && MemberQ[#, _?(# >= 10 &)] &@ Tally[Flatten[Outer[GCD, #, #]]][[All, -1]] &@ {a[i - 3], a[i - 2], a[i - 1], k}], k++]; Set[{a[i], c[k]}, {k, i}]; If[k == u, While[c[u] > 0, u++]], {i, len + 2, nn}]; Array[a, nn] ] (* _Michael De Vlieger_, Jun 06 2022 *) %o A354732 (PARI) \\ See Corneth link %Y A354732 Cf. A098550, A336957, A352950, A354717. %K A354732 nonn %O A354732 1,2 %A A354732 _David James Sycamore_, Jun 04 2022 %E A354732 More terms from _David A. Corneth_, Jun 05 2022