OFFSET
1,2
COMMENTS
This sequence is a hybrid of the selection rules of the Yellowstone permutation A098550 and the Enots Wolley sequence A336957. As in the latter, to ensure the sequence is infinite an additional rule is applied: a(n) cannot have the same set of prime divisors as a(n-1).
Like the EKG sequence A064413, the primes p appear in natural order, and 2p precedes p. However, unlike A064413, the term following p is not 3p, but rather a term close to 2p, typically 2p+2.
The sequence is conjectured to be a permutation of the positive integers. Because of the selection rule at most two consecutive terms can be even, although the number of consecutive odd terms is likely arbitrarily large.
In the first 100000 terms the fixed points are 1,2,3,4,12. It is likely no more exist.
LINKS
Scott R. Shannon, Table of n, a(n) for n = 1..10000
Scott R. Shannon, Image of the first 100000 terms. The green line is y = n.
EXAMPLE
a(4) = 4 as a(2) = 2, a(3) = 3, and 4 is the smallest unused number that has a common factor with 2 but not with 3.
a(5) = 9 as a(3) = 3, a(4) = 4, and 9 is the smallest unused number that is coprime to 4 but not to 3. Note that 8 also meets the selection criteria, but its only prime factor, 2, is shared with a(4) = 4, so 8 cannot be chosen as a(5) because then a(6) would not exist.
PROG
(MATLAB)
function a = A353239( max_n )
a = [1 2 3];
m = [1:max_n];
b = cell(1, max_n); b{1} = [1]; b{2} = [2]; b{3} = [3];
for n = 4:max_n
j = 4; k = m(j); f = factor(k);
while ((isempty(intersect(b{n-2}, f)) ~= ~isempty(intersect(b{n-1}, f)))...
||isequal(unique(b{n-1}), unique(f)))
j = j+1;
k = m(j);
f = factor(k);
end
a(n) = k;
b{n} = f;
m(m==k) = []; m(end+1) = m(end)+1;
end
end % Thomas Scheuerle, Apr 12 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Apr 08 2022
STATUS
approved