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”).

A364364
For n <= 3 a(n) = n. Label a(n-3), a(n-2), a(n-1) i,j,k respectively. If i,j,k are pairwise coprime a(n) is the least unused number which shares a divisor with k. Otherwise a(n) is the least unused number coprime to j.
1
1, 2, 3, 6, 4, 5, 7, 14, 8, 9, 11, 22, 10, 13, 17, 34, 12, 15, 19, 16, 18, 21, 23, 20, 24, 27, 25, 26, 28, 29, 31, 62, 30, 33, 37, 32, 36, 35, 41, 82, 38, 39, 43, 86, 40, 45, 47, 44, 42, 49, 53, 46, 48, 51, 55, 50, 52, 57, 59, 118, 54, 61, 65, 60, 56, 67, 69, 63
OFFSET
1,2
COMMENTS
The sequence starts with 1,2,3, this being the earliest triple of three consecutive positive integers which are pairwise coprime. Such triples occur frequently as the sequence extends, and those which end with k = prime p produce a(n) = 2*p and such terms present local spikes in the plot (corresponding primes start 3,7,11,17,31,41,...). Similar behavior is observed in A091857.
A prime can only occur when i,j,k are not pairwise coprime, then a(n) is coprime to j, and so can be a prime.
Conjectured to be a permutation of the positive integers, with primes occurring in natural order.
From Michael De Vlieger, Jul 21 2023: (Start)
The scatterplot exhibits 3 trajectories. From earliest to latest, we see the following:
"Alpha" contains squarefree semiprime a(n) = k such that k > n, k mod 4 = 2. Terms in this sequence are preceded by primes.
"Gamma" contains odd k.
"Beta" contains even composite k such that n > k, including some squarefree semiprimes.(End)
LINKS
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^12 showing primes in red, composite prime powers in gold, squarefree composites in green, and nonsquarefree numbers that are not prime powers in blue, highlighting squareful numbers that are not prime powers in large light blue.
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^10, showing three trajectories, alpha in green containing squarefree semiprimes k such that k mod 4 = 2, gamma in blue containing odd numbers, and beta in red containing even numbers not in alpha.
EXAMPLE
a(4) = 6 because 1,2,3 are pairwise coprime and 6 is the smallest unused number sharing a divisor with 3.
a(4,5,6) = 6,4,5 which is not a pairwise coprime triple, so a(7) = 7, the least unused number which is coprime to 4.
MATHEMATICA
nn = 120; c[_] := False; m[_] := 1; h = 1; i = 2; j = 3; u = 4;
Array[Set[{a[#], c[#]}, {#, True}] &, 3];
Do[If[CoprimeQ[h, i, j],
If[PrimePowerQ[j],
k = FactorInteger[j][[1, 1]]; While[c[k m[k]], m[k]++]; k *= m[k],
k = u; While[Or[c[k], CoprimeQ[j, k]], k++] ],
k = u; While[Or[c[k], ! CoprimeQ[i, k]], k++] ];
Set[{a[n], c[k], h, i, j}, {k, True, i, j, k}];
If[k == u, While[c[u], u++]], {n, 4, nn}];
Array[a, nn] (* Michael De Vlieger, Jul 21 2023 *)
CROSSREFS
Cf. A091857.
Sequence in context: A130385 A122347 A368427 * A194867 A194834 A195109
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from David A. Corneth, Jul 21 2023
STATUS
approved