OFFSET
1,2
COMMENTS
This sequence uses a similar rule to A088177 but here all neighboring terms also share a factor. In the first 500000 terms the fixed points are 1,2,4,6, it is likely no more exist, while the smallest number not to have appeared is 1153. The sequence is conjectured to be a permutation of the positive integers.
See A354754 for the products of all pairs of terms.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Annotated log-log scatterplot of a(n) n = 1..2^14, showing records in red, a(n) = 2 in blue, fixed points highlighted in gold.
Scott R. Shannon, Image of the first 50000 terms.
EXAMPLE
a(7) = 2 as a(6) = 6 and 2 is the smallest positive number that shares a factor with 6 and whose product with 6, 2 * 6 = 12, has not previously appeared.
MATHEMATICA
nn = 120; c[_] = 0; a[1] = c[1] = 1; a[2] = a[2] = j = 2; Do[k = 2; While[Nand[c[j*k] == 0, ! CoprimeQ[j, k]], k++]; Set[{a[n], c[j*k]}, {k, n}]; j = k, {n, 3, nn}]; Array[a, nn] (* Michael De Vlieger, Jun 15 2022 *)
PROG
(PARI) lista(nn) = my(va = vector(nn), vp = vector(nn-2)); va[1] = 1; va[2] = 2; for (n=3, nn, my(k=2); while ((gcd(k, va[n-1]) == 1) || #select(x->(x==k*va[n-1]), vp), k++); va[n] = k; vp[n-2] = k*va[n-1]; ); va; \\ Michel Marcus, Jun 14 2022
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Scott R. Shannon, Jun 06 2022
STATUS
approved