A354753 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest positive number that shares a factor with a(n-1) and the product a(n) * a(n-1) is distinct from all previous products a(i) * a(i-1), i=2..n-1.
1, 2, 2, 4, 4, 6, 2, 10, 4, 8, 6, 3, 3, 9, 6, 6, 10, 5, 5, 15, 3, 21, 6, 12, 8, 8, 10, 10, 12, 9, 9, 15, 6, 14, 2, 22, 4, 14, 7, 7, 21, 9, 18, 8, 14, 10, 15, 12, 14, 14, 16, 8, 20, 10, 22, 6, 26, 2, 34, 4, 26, 8, 22, 11, 11, 33, 3, 39, 6, 32, 8, 30, 9, 24, 12, 21, 14, 20, 15, 15, 21, 18, 18
Offset: 1
Examples
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.
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.
Programs
-
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 *)
-
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
Comments