OFFSET
1,2
COMMENTS
Although all primes likely appear they do not occur in their natural order, e.g., 37 appears before 31. In the range studied each time a prime appears, beyond the initial 2, the previous term is a multiple of the same prime. The largest multiple in the first 500000 terms is six, first occurring at a(7782) = 8286, a(7783) = 1381. It is unknown if this ratio is unbounded for large n. As a prime term is less than its previous term the term following the prime will share a factor with previous multiple of the prime. This factor appears to always be a factor of the multiple and thus the term is not another multiple of the prime.
In the first 500000 terms the fixed points are 1, 2, 15, 25, 35. It is likely no more exist. The sequence is conjectured to be a permutation of the positive integers.
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 100000 terms. The green line is y = n.
EXAMPLE
a(4) = 6 as max(a(2),a(3)) = max(2,4) = 4, and 6 is the smallest unused number that shares a factor with 4.
a(5) = 3 as max(a(3),a(4)) = max(4,6) = 6, and 3 is the smallest unused number that shares a factor with 6.
MATHEMATICA
nn = 2^10; u = 1; c[_] = 0; MapIndexed[Set[{a[First[#2]], c[#1]}, {#1, First[#2]}], {1, 2}]; While[c[u] > 0, u++]; Do[m = Max[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 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Apr 13 2022
STATUS
approved