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 A384503 #12 Jun 05 2025 23:26:05 %S A384503 1,2,3,4,6,5,8,10,7,12,14,9,16,15,18,11,20,22,13,24,26,17,28,34,19,30, %T A384503 38,21,32,27,36,23,33,46,39,40,42,25,35,29,45,58,48,31,44,62,37,50,74, %U A384503 41,52,82,43,54,86,47,56,94,49,60,63,53,51,106,57,64,66,59 %N A384503 Lexicographically earliest infinite sequence of distinct positive integers having the property that for any pair a(n-2) = i, a(n-1) = j of consecutive terms > 1, a(n) is the smallest novel k such that gcd(i,k) > 1 if gcd(i,j) = 1 or gcd(j,k) = 1 if gcd(i,j) > 1. %C A384503 Three initial terms (1,2,3) are needed since starting 1,2 would require 1 to have a prime factor. %C A384503 Similar to A280985 except that if for some m, a(m) = prime p, then a(m+2) = 2*p (whereas A280985(m+1) = 2*p). %C A384503 Conjectured to be a permutation of the positive integers, with primes occurring in order. %H A384503 Michael De Vlieger, <a href="/A384503/b384503.txt">Table of n, a(n) for n = 1..10000</a> %H A384503 Michael De Vlieger, <a href="/A384503/a384503.png">Log log scatterplot of a(n)</a>, n = 1..2^10, showing primes in red, prime powers in gold, squarefree composites in green, and numbers neuther squarefree nor prime powers in blue and magenta, with magenta additionally representing powerful numbers that are not prime powers. %H A384503 Michael De Vlieger, <a href="/A384503/a384503_1.png">Log log scatterplot of a(n)</a>, n = 1..2^20. %F A384503 For prime a(n) = p, a(n+2) = 2*p. - _Michael De Vlieger_, May 31 2025 %e A384503 The lexicographically earliest condition requires that the sequence starts a(n) = n for n <= 3. Then with a(2) = 2 and a(3) = 3 a(4) must be 4, the smallest novel number sharing a prime divisor with 2 (since gcd(2,3) = 1). Since gcd(3,4) = 1, a(5) must be 6, the smallest novel number sharing a prime divisor with 3. Since gcd(4,6) > 1 a(6) = 5, the smallest novel number prime to a(4) = 4. a(8) = 8 because gcd(6,5) = 1 and then a(9) = 2*5 = 10 the smallest novel number sharing a factor with 5. %t A384503 nn = 120; c[_] := False; m[_] := 1; c[1] = c[2] = c[3] = True; i = 2; j = 3; u = 4; %t A384503 Range[3]~Join~Reap[Do[ %t A384503 If[CoprimeQ[i, j], %t A384503 If[PrimePowerQ[i], %t A384503 p = FactorInteger[i][[1, 1]]; While[c[p*m[p]], m[p]++]; k = p*m[p], %t A384503 k = u; While[Or[c[k], CoprimeQ[i, k]], k++] ], %t A384503 k = u; While[Or[c[k], ! CoprimeQ[j, k]], k++] ]; %t A384503 Sow[k]; Set[{c[k], i, j}, {True, j, k}]; %t A384503 If[k == u, While[c[u], u++]], {n, 3, nn}] ][[-1, 1]] (* _Michael De Vlieger_, May 31 2025 *) %Y A384503 Cf. A000027, A064413, A280985, A127202. %K A384503 nonn %O A384503 1,2 %A A384503 _David James Sycamore_, May 31 2025