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

A362552
a(n) = n for n <= 2. For n > 2, a(n) is the least novel k (with rad(k) != rad(a(n-1))) such that k shares a nontrivial divisor with one of a(n-1), a(n-2), but not with the other.
1
1, 2, 6, 3, 4, 9, 8, 10, 5, 12, 14, 7, 16, 18, 15, 22, 11, 20, 24, 21, 26, 13, 28, 30, 25, 27, 33, 44, 32, 55, 34, 17, 36, 38, 19, 40, 35, 46, 23, 42, 39, 49, 45, 48, 52, 51, 50, 56, 63, 57, 70, 58, 29, 54, 60, 65, 62, 31, 64, 66, 69, 68, 74, 37, 72, 75, 76, 81, 80, 82, 41, 78, 84, 77, 86, 43, 88, 90
OFFSET
1,2
COMMENTS
The sequence definition is related to those of A098550 and A336957 in the sense that the next term a(n) is chosen according to whichever of the two criteria delivers the least unused number, subject to the rad condition.
The rule that rad(k) != rad(a(n-1)) is necessary to ensure that the next term always exists (see Example).
Odd primes p appear as 2*p, p, u where u is the least unused even term.
Conjectured to be a permutation of the positive integers in which the primes appear in natural order.
LINKS
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^12, showing primes in red, other prime powers in gold, squarefree composites in green, and numbers neither squarefree nor prime powers in blue, highlighting numbers in A286708 in large light blue.
EXAMPLE
With a(1) = 1 and a(2) = 2, the least k prime to 1 but not to 2 would be 4, but this will not work because rad(2) = rad(4), preventing selection of the next term a(4). Therefore a(3) is 6, which is prime to 1 but not to 2. The next term, a(4) is 3, the smallest number prime to 2 but not to 6. a(5) cannot be 9 because rad(3) = rad(9) but 4 fits, being prime to 3 but not to 6; and so on.
MATHEMATICA
nn = 120; c[_] = False;
rad[x_] := rad[x] = Times @@ FactorInteger[x][[All, 1]];
Array[Set[{a[#], c[#]}, {#, True}] &, 2]; i = a[1]; j = a[2]; u = 3;
Do[k = u;
While[
Nand[! c[k], Xor[CoprimeQ[k, i], CoprimeQ[k, j]],
rad[j] != rad[k]], k++];
Set[{a[n], c[k], i, j}, {k, True, j, k}];
If[k == u, While[c[u], u++]], {n, 3, nn}];
Array[a, nn] ] (* Michael De Vlieger, Apr 27 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved