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 A352849 #10 May 24 2022 17:12:08 %S A352849 1,3,5,2,7,9,4,11,13,6,17,19,8,15,23,14,25,27,16,29,21,10,31,33,20,37, %T A352849 39,22,35,41,12,43,47,18,49,53,24,55,59,26,45,61,28,51,65,32,57,67,34, %U A352849 63,71,38,69,73,40,77,79,30,83,89,36,85,91,44,75,97,46,81 %N A352849 a(n) is the least k not already in the sequence such that k is pairwise coprime to a(n-1) and a(n-2), starting with a(1) = 1, a(2) = 3, and a(3) = 5. %C A352849 Sequence begins with 1 and the first 2 odd primes. %C A352849 a(3k+1) is even for k > 0 as consequence of definition and since 2 is the smallest prime and numbers are either even or odd. Unlike A085229, even numbers in this sequence do not appear in order. Hence a(3k) and a(3k+2) are odd. %C A352849 The smallest missing number u is even, and there is a smallest missing odd number v that applies to a(3k) and a(3k+2). %C A352849 Let q be odd and prime. In a given interval i <= n <= j, we either have 2q | a(n) or we have q | a(n) odd. %C A352849 Regarding 6 | a(n), there are phases i <= n <= j where 6 | a(3k+1) and no a(n) mod 6 = 3 appear. These begin when 3 | a(3k+1) and prevent the entry of 3 | v. Whereupon all u such that 6 | u have been consumed, 3 | a(3k+r), r != 1 occurs, and we move into a phase where we have a(n) mod 6 = 3, but no 6 | a(3k+1) appear. This occurs until all v such that 3 | v have been consumed, and 3 | a(3k+1) once again. %C A352849 Conjecture: the sequence is a permutation of the natural numbers. %H A352849 Michael De Vlieger, <a href="/A352849/b352849.txt">Table of n, a(n) for n = 1..10000</a> %H A352849 Michael De Vlieger, <a href="/A352849/a352849.png">Annotated log-log scatterplot of a(n)</a>, n = 1..2^12, showing odd numbers congruent to 1 or 5 (mod 6) in green, odd numbers congruent to 3 (mod 6) in blue, even numbers congruent to 2 or 4 (mod 6) in red, and numbers divisible by 6 in amber. %p A352849 ina := proc(n) false end: # adapted from code for A352950 %p A352849 a := proc (n) option remember; local k; %p A352849 if n < 4 then k := 2*n-1 %p A352849 else for k from 2 while ina(k) or igcd(k, a(n-1)) <> 1 or igcd(k, a(n-2)) <>1 %p A352849 do %p A352849 end do %p A352849 end if; ina(k):= true; k %p A352849 end proc: %p A352849 seq(a(n), n = 1 .. 100); # -_David James Sycamore_, Apr 17 2022 %t A352849 nn = 66, c[_] = 0; Array[Set[{a[#1], c[#2]}, {#2, #1}] & @@ {#, 2 # - 1} &, 3]; u = 2; Do[k = u; m = LCM @@ Array[a[i - #] &, 2]; While[Nand[c[k] == 0, CoprimeQ[m, k]], k++]; Set[{a[i], c[k]}, {k, i}]; If[a[i] == u, While[c[u] > 0, u++]], {i, 4, nn}]; Array[a, nn] %o A352849 (Python) %o A352849 from math import gcd %o A352849 from itertools import islice %o A352849 def agen(): # generator of terms %o A352849 aset, b, c = {1, 3, 5}, 3, 5 %o A352849 yield from [1, b, c] %o A352849 while True: %o A352849 k = 1 %o A352849 while k in aset or any(gcd(t, k) != 1 for t in [b, c]): k+= 1 %o A352849 b, c = c, k %o A352849 aset.add(k) %o A352849 yield k %o A352849 print(list(islice(agen(), 68))) # _Michael S. Branicky_, Apr 14 2022 %Y A352849 Cf. A085229, A352950. %K A352849 nonn %O A352849 1,2 %A A352849 _Michael De Vlieger_, Apr 14 2022