login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A358534
Start with a(1)=1, a(2)=2. Thereafter, if gcd(a(n-2),a(n-1)) = 1 then a(n) is the smallest unused k such that gcd(a(n-2),k) > 1 and gcd(a(n-1),k) = 1, otherwise a(n) is the smallest unused k such that gcd(a(n-2),k) = 1 and gcd(a(n-1),k) > 1. If the latter is impossible, then a(n) = smallest missing number u. (See comments.)
2
1, 2, 4, 3, 9, 5, 10, 6, 25, 35, 7, 15, 12, 55, 11, 20, 8, 45, 21, 40, 16, 65, 13, 30, 14, 27, 33, 17, 34, 18, 85, 95, 51, 24, 119, 49, 68, 22, 153, 39, 136, 28, 187, 99, 170, 26, 75, 57, 50, 32, 105, 63, 80, 38, 115, 23, 60, 36, 125, 145, 19, 76, 29, 87, 31, 62
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
Sequence in context: A000463 A366260 A366946 * A137442 A350150 A111390
KEYWORD
nonn
AUTHOR
STATUS
approved