OFFSET
1,2
COMMENTS
The sequence uses the selection rules for a(n) of either A336957 or A098550 if a(n-1) is greater than or less than a(n-2) respectively. For the four combinations of the relative sizes of a(n-2), a(n-1) and a(n), only for the case a(n-2) < a(n-1) < a(n) do we need to ensure that a(n) contains a prime factor that is not in a(n-1), as in A336957. The other cases need not be checked as the rules ensure the next term will always exist, e.g., for a(n-2) < a(n-1) > a(n), a(n-1) must contain a prime factor not in a(n), which ensures a(n+1) will exist, as if it didn't a(n) would have been chosen for a(n-1) instead.
For the terms studied the primes do not all occur in their natural order, although those primes out of order are relatively rare, the first being a(140) = 41. The primes all fall in the lower lines of terms that comprise the graph; see the attached colored image.
In the first 250000 terms the fixed points are 1, 2, 8, 15, 25, 42, 49, 81, 90, 564; it is not known if more exist. The sequence is conjectured to be a permutation of the positive integers.
LINKS
Scott R. Shannon, Table of n, a(n) for n = 1..10000
Scott R. Shannon, Image of the first 250000 terms. The colors are graduated across the spectrum to show the total number of prime factors of each term, with red being one prime factor. The thin green line is a(n) = n.
EXAMPLE
a(6) = 10 as a(5) = 4 > a(4) = 3, and 10 is an unused number and shares a factor with 4 while being coprime to 3. Note that 8 also has these properties, but 8 contains no prime factor that is not in a(4) = 4, thus choosing 8, which is larger than a(4) = 4, would halt the sequence as a(7) would then not exist.
a(11) = 14 as a(10) = 9 < a(9) = 12, and 14 is the smallest unused number that shares a factor with 12 while being coprime to 9.
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Sep 07 2025
STATUS
approved
