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.
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, 38, 21, 32, 27, 36, 23, 33, 46, 39, 40, 42, 25, 35, 29, 45, 58, 48, 31, 44, 62, 37, 50, 74, 41, 52, 82, 43, 54, 86, 47, 56, 94, 49, 60, 63, 53, 51, 106, 57, 64, 66, 59
Offset: 1
Keywords
Examples
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.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
- Michael De Vlieger, Log log scatterplot of a(n), 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.
- Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^20.
Programs
-
Mathematica
nn = 120; c[] := False; m[] := 1; c[1] = c[2] = c[3] = True; i = 2; j = 3; u = 4; Range[3]~Join~Reap[Do[ If[CoprimeQ[i, j], If[PrimePowerQ[i], p = FactorInteger[i][[1, 1]]; While[c[p*m[p]], m[p]++]; k = p*m[p], k = u; While[Or[c[k], CoprimeQ[i, k]], k++] ], k = u; While[Or[c[k], ! CoprimeQ[j, k]], k++] ]; Sow[k]; Set[{c[k], i, j}, {True, j, k}]; If[k == u, While[c[u], u++]], {n, 3, nn}] ][[-1, 1]] (* Michael De Vlieger, May 31 2025 *)
Formula
For prime a(n) = p, a(n+2) = 2*p. - Michael De Vlieger, May 31 2025
Comments