OFFSET
1,2
COMMENTS
A lexicographically earliest sequence. We write (i,j) to mean gcd(i,j) for brevity. Let rad(m) = A007947(m).
Define (i,j)=1 to be "closed" else "open". If we have i and j closed, then we find the least k not already in the sequence that is closed to i but open to j, otherwise we find same that is open to i but closed to j.
Condition [1], (i,j)=1 requires smallest unused k such that (i,k)=1 and (j,k)>1, given primes p|i, merely by finding the smallest missing k indivisible by any p.
Condition [2], (i,j)>1, requires smallest unused k such that (i,k)>1 and (j,k)=1 iff rad(i) does not divide rad(j).
Let S = {p | i} and T = {q | j}. If T contains S, then (j,k)=1 makes (i,k)>1 impossible.
Condition [3] allows a solution. In this case, we simply set a(n) = u, the smallest missing number in a(1..n-1).
The most conspicuous case of [3] is i = p^v and j = p^w, v < w. Since p^v | p^w, if a(n) = k is made such that (p^w,k)=1, then k is also coprime to p^v or any power of p. Hence we write a(n) = u.
Another, rare case of [3] is if i and j belong to R, the sequence of numbers that are products of the same squarefree kernel K. Suppose K = 6, then R = A003586. Now suppose i = 6*R(2) = 6*2 = 12 and j = 6*R(3) = 6*3 = 18. Indeed, if a(n) = k is made such that (18,k)=1, then k is also coprime to 12 and any number in 6*R. Hence in this case we write a(n) = u.
LINKS
Michael De Vlieger, Scatterplot of a(n), n = 1..2^16.
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^14, showing records in red, local minima in blue, highlighting primes in green and other prime powers in gold.
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^12, showing terms generated by condition [1] in blue, [2] in green, and [3] in red.
MATHEMATICA
nn = 120; c[_] = False; q[_] = 1; f[n_] := Times @@ FactorInteger[n][[All, 1]]; Array[Set[{a[#], c[#]}, {#, True}] &, 2]; Set[{i, j, u}, {a[1], a[2], 3}]; Set[{r, s}, {f[i], f[j]}]; Do[Which[CoprimeQ[i, j], If[PrimeNu[j] == 1, While[c[q[s] s], q[s]++]; k = q[s]; While[Nand[! c[s k], CoprimeQ[i, k]], k++]; k *= s, k = u; While[Nand[! c[k], CoprimeQ[i, k], ! CoprimeQ[j, k]], k++]], Divisible[s, r], k = u, True, If[PrimeNu[i] == 1, While[c[q[r] s], q[r]++]; k = q[r]; While[Nand[! c[r k], CoprimeQ[j, k]], k++]; k *= r, k = u; While[Nand[! c[k], ! CoprimeQ[i, k], CoprimeQ[j, k]], k++]] ]; Set[{a[n], c[k], i, j, r, s}, {k, True, j, k, s, f[k]}]; If[k == u, While[c[u], u++]], {n, 3, nn}]; Array[a, nn]
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael De Vlieger and David James Sycamore, Nov 20 2022
STATUS
approved