cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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).

This page as a plain text file.
%I A353239 #22 Jul 25 2022 22:41:28
%S A353239 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,
%T A353239 25,42,33,34,17,30,36,55,38,19,40,44,45,39,50,46,23,48,51,52,56,49,54,
%U A353239 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
%N 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).
%C A353239 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).
%C A353239 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.
%C A353239 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.
%C A353239 In the first 100000 terms the fixed points are 1,2,3,4,12. It is likely no more exist.
%H A353239 Scott R. Shannon, <a href="/A353239/b353239.txt">Table of n, a(n) for n = 1..10000</a>
%H A353239 Scott R. Shannon, <a href="/A353239/a353239.png">Image of the first 100000 terms</a>. The green line is y = n.
%e A353239 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.
%e A353239 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.
%o A353239 (MATLAB)
%o A353239 function a = A353239( max_n )
%o A353239     a = [1 2 3];
%o A353239     m = [1:max_n];
%o A353239     b = cell(1,max_n); b{1} = [1]; b{2} = [2]; b{3} = [3];
%o A353239     for n = 4:max_n
%o A353239         j = 4; k = m(j); f = factor(k);
%o A353239         while ((isempty(intersect(b{n-2},f)) ~= ~isempty(intersect(b{n-1},f)))...
%o A353239                 ||isequal(unique(b{n-1}),unique(f)))
%o A353239             j = j+1;
%o A353239             k = m(j);
%o A353239             f = factor(k);
%o A353239         end
%o A353239         a(n) = k;
%o A353239         b{n} = f;
%o A353239         m(m==k) = []; m(end+1) = m(end)+1;
%o A353239     end
%o A353239 end % _Thomas Scheuerle_, Apr 12 2022
%Y A353239 Cf. A336957, A098550, A064413, A270139, A084937.
%K A353239 nonn
%O A353239 1,2
%A A353239 _Scott R. Shannon_, Apr 08 2022