A352968 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest positive number that has not appeared that shares a factor with min(a(n-2),a(n-1)).
1, 2, 3, 4, 6, 8, 9, 10, 12, 5, 15, 20, 18, 14, 7, 21, 28, 24, 16, 22, 26, 11, 33, 44, 27, 30, 36, 25, 35, 40, 42, 32, 34, 38, 17, 51, 68, 39, 13, 52, 65, 46, 23, 69, 92, 45, 48, 50, 54, 55, 56, 60, 49, 63, 70, 57, 19, 76, 95, 58, 29, 87, 116, 66, 62, 31, 93, 124, 72, 64, 74, 78, 37, 111, 148, 75
Offset: 1
Keywords
Examples
a(4) = 4 as min(a(2),a(3)) = min(2,3) = 2, and 4 is the smallest unused number that shares a factor with 2. a(5) = 6 as min(a(3),a(4)) = min(3,4) = 3, and 6 is the smallest unused number that shares a factor with 3.
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 and local minima in blue, highlighting primes in green and fixed points in amber.
- Scott R. Shannon, Image of the first 200000 terms. The green line is y = n.
Programs
-
Mathematica
nn = 2^10; u = 1; c[] = 0; MapIndexed[Set[{a[First[#2]], c[#1]}, {#1, First[#2]}], Range[3]]; While[c[u] > 0, u++]; Do[m = Min[Array[a[i - #] &, 2]]; k = u; While[Or[c[k] > 0, CoprimeQ[m, k]], k++]; Set[{a[i], c[k]}, {k, i}]; If[k == u, While[c[u] > 0, u++]], {i, Length[s] + 1, nn}]; Array[a, nn] (* _Michael De Vlieger, Apr 14 2022 *)
Comments