login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


A353239
Lexicographically earliest infinite sequence of distinct positive numbers such that, for n > 2, a(n) has either a common factor with a(n-1) but not with a(n-2), or with a(n-2) but not with a(n-1).
3
1, 2, 3, 4, 9, 8, 10, 5, 6, 14, 7, 12, 15, 16, 21, 20, 22, 11, 18, 26, 13, 24, 27, 28, 32, 35, 25, 42, 33, 34, 17, 30, 36, 55, 38, 19, 40, 44, 45, 39, 50, 46, 23, 48, 51, 52, 56, 49, 54, 57, 58, 29, 60, 62, 31, 64, 66, 63, 68, 69, 70, 65, 72, 74, 37, 76, 78, 75, 82, 41, 80, 84, 77, 81, 87, 116
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, 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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 23 06:50 EDT 2024. Contains 376143 sequences. (Running on oeis4.)