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.
%I A330647 #13 Dec 26 2019 05:35:10 %S A330647 1,2,3,5,6,4,7,9,10,11,13,14,8,12,17,19,22,16,23,24,15,26,28,20,21,18, %T A330647 25,29,30,31,32,34,37,38,40,35,41,43,44,33,27,36,47,52,39,46,51,42,48, %U A330647 49,53,56,58,59,61,64,60,45,62,63,57,67,68,71,73,74,77 %N A330647 Lexicographically earliest sequence of distinct positive terms with an associate sequence t such that a(1) = t(1) = 1 and for n > 1, either a(n) divides t(n-1) (and in that case set t(n) = t(n-1)/a(n)) or a(n) is coprime to t(n-1) (and in that case set t(n) = t(n-1)*a(n)). %C A330647 All prime numbers appear in the sequence, in ascending order. %C A330647 This sequence is likely a permutation of the natural numbers. %H A330647 Rémy Sigrist, <a href="/A330647/b330647.txt">Table of n, a(n) for n = 1..10000</a> %H A330647 Rémy Sigrist, <a href="/A330647/a330647.png">Scatterplot of (n, a(n)-n) for n = 1..250000</a> %H A330647 Rémy Sigrist, <a href="/A330647/a330647.gp.txt">PARI program for A330647</a> %e A330647 The first terms, alongside the corresponding t(n), are: %e A330647 n a(n) t(n) %e A330647 -- ---- ---- %e A330647 1 1 1 %e A330647 2 2 2 %e A330647 3 3 6 %e A330647 4 5 30 %e A330647 5 6 5 %e A330647 6 4 20 %e A330647 7 7 140 %e A330647 8 9 1260 %e A330647 9 10 126 %e A330647 10 11 1386 %t A330647 Nest[Append[#1, Block[{k = 2, s}, While[Nand[FreeQ[#1[[All, 1]], k], MemberQ[{1, k}, Set[s, GCD[#3, k]]]], k++]; {k, If[s == 1, #3 k, #3/k]}]] & @@ {#, #[[-1, 1]], #[[-1, -1]]} &, {{1, 1}}, 66][[All, 1]] (* _Michael De Vlieger_, Dec 23 2019 *) %o A330647 (PARI) See Links section. %Y A330647 See A330648 for the corresponding sequence t. %Y A330647 Cf. A008336. %K A330647 nonn %O A330647 1,2 %A A330647 _Rémy Sigrist_, Dec 22 2019