OFFSET
1,2
COMMENTS
Similar to the Enots Wolley sequence A336957 the next term, when required, is chosen so that the sequence is infinite. All terms must satisfy the condition of sharing a factor with the largest previous term and not with the second largest previous term. When such a term is smaller than the second largest previous term then no other restriction need be applied since it will not influence subsequent terms in the sequence. This means such terms can be prime or a prime power - this is in contrast to A336957 where such numbers cannot occur.
When the next term is larger than the current second largest term but smaller than the largest term then it must be chosen so that the largest term has a prime factor not in common with it. When the next term is larger than the current largest term then it must be chosen so that it has a prime factor not in common with the current largest term. These later conditions ensure that the following term always exists. See the examples below. Although these rules are enforced surprisingly, in the first 200000 terms, they are very rarely required. Only three times in this range is a number, which is larger than the current largest value, rejected as it would not have a unique prime factor with the current largest term. And in the same range a number, between the current largest and second largest term, is never rejected as it would have all the same prime factors as the current largest term. If this holds true as n grows arbitrarily large is unknown.
The primes do not occur in their natural order, and the terms before and after prime values can be a large multiple of the prime, e.g. a(2147) = 3097, a(2148) = 19, a(2149) = 361. The sequence is conjectured to be a permutation of the positive integers although it may take many terms for some primes to appear, e.g., 29 has not occurred after 200000 terms. In the same range the fixed points beyond 2 are 92 and 40100, although it is possible more exist.
LINKS
Scott R. Shannon, Image of the first 150000 terms. The green line is y = n.
EXAMPLE
a(4) = 3 as the largest and second largest previous terms are a(3) = 6 and a(2) = 2 respectively, and 3 is the smallest unused number that shares a factor with 6, not with 2, and does not contain the same prime factors as 6.
a(6) = 15 as the largest and second largest previous terms are a(3) = 6 and a(5) = 4 respectively, and 15 is the smallest unused number that shares a factor with 6, not with 4, and has a prime factor not in common with 6. Note that 9 satisfies the first two conditions but not the third.
a(7) = 5 as the largest and second largest previous terms are a(6) = 15 and a(3) = 6 respectively, and 5 is the smallest unused number that shares a factor with 15 but not with 6.
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Scott R. Shannon, May 03 2022
STATUS
approved