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 A354717 #26 Jul 01 2025 23:33:43 %S A354717 1,2,4,6,5,8,12,14,11,10,16,18,7,20,15,24,13,3,9,21,17,27,30,33,19,22, %T A354717 36,26,23,28,32,34,25,38,42,44,29,40,46,48,31,50,45,35,37,55,60,65,41, %U A354717 39,52,54,43,56,58,62,47,64,66,68,49,51,72,57,53,63,69,75 %N A354717 Lexicographically earliest infinite sequence of distinct positive integers such that in any run of four consecutive terms there is one term which is prime to the other three, none of which are pairwise coprime. %C A354717 Can be regarded as the reverse of A354732, which has the opposite coprime relations to those defined here. Records tend to be nonprime, but not all nonprimes are records. %C A354717 The primes do not appear in natural order (5 and 7 precede 3). %C A354717 Open question: Is it true that in any run of four consecutive terms there is always a prime or prime power (this being the term prime to the other three)? %C A354717 Conjecture: Sequence is a permutation of the positive integers. %H A354717 Michael De Vlieger, <a href="/A354717/b354717.txt">Table of n, a(n) for n = 1..10000</a> %H A354717 Michael De Vlieger, <a href="/A354717/a354717.png">Scatterplot of a(n)</a>, n = 1..512, showing primes in red, odd composites in gold, and evens in blue. %e A354717 a(1,2,3,4) = 1,2,4,6 is the lexicographically earliest string of four consecutive numbers which satisfy the definition, hence the sequence starts with these terms. %e A354717 a(13,14,15) = 7,20,15 respectively, and 24 is the least unused number such that 7 is prime to 20,15 and 24, whereas (20,15)=5, (15,24)=3 and (20,24)=2. Therefore a(16)=24. %t A354717 Block[{a, c, k, len, u, nn}, nn = 120; c[_] = 0; MapIndexed[Set[{a[First[#2]], c[#1]}, {#1, First[#2]}] &, {1, 2, 4, 6}]; len = u = 3; Do[k = u; While[Nand[c[k] == 0, Union@ Tally@ Map[Count[#, 1] &, Outer[GCD, #, #]] == {{1, len}, {len, 1}} &@ {a[i - 3], a[i - 2], a[i - 1], k}], k++]; Set[{a[i], c[k]}, {k, i}], {i, len + 2, nn}]; Array[a, nn] ] (* _Michael De Vlieger_, Jun 05 2022 *) %Y A354717 Cf. A098550, A336957, A352950, A354732. %K A354717 nonn %O A354717 1,2 %A A354717 _David James Sycamore_, Jun 03 2022