%I #20 Jun 08 2022 16:14:10
%S 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 18,24,37,35,26,32,33,41,28,34,39,43,38,40,47,49,30,36,53,59,42,44,61,
%U 65,45,46,67,51,50,52,71,57,56,58,55,69,62,63,73,64,68,75,77
%N 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 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 Conjecture: Sequence is a permutation of the positive integers in which the primes appear in their natural order.
%H Michael De Vlieger, <a href="/A354732/b354732.txt">Table of n, a(n) for n = 1..10000</a>
%H David A. Corneth, <a href="/A354732/a354732.gp.txt">PARI program</a>
%H 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 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 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 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 nn = 120; c[_] = 0; len = 3; Array[Set[{a[#], c[#]}, {#, #}] &, len + 1]; u = 5;
%t 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 (PARI) \\ See Corneth link
%Y Cf. A098550, A336957, A352950, A354717.
%K nonn
%O 1,2
%A _David James Sycamore_, Jun 04 2022
%E More terms from _David A. Corneth_, Jun 05 2022