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 A251413 #43 Jan 29 2025 13:09:36 %S A251413 1,3,5,9,25,21,55,7,11,35,33,49,15,77,27,91,45,13,51,65,17,39,85,57, %T A251413 115,19,23,95,69,125,63,145,81,29,75,203,93,119,31,105,341,87,121,111, %U A251413 143,37,99,185,117,155,123,175,41,133,205,147,215,141,43,47,129 %N A251413 a(n) = 2n-1 if n <= 3, otherwise the smallest odd number not occurring earlier having at least one common factor with a(n-2), but none with a(n-1). %C A251413 Conjecture 1: Sequence is a permutation of the odd numbers. %C A251413 Conjecture 2: The odd primes occur in the sequence in their natural order. %C A251413 Comments from _N. J. A. Sloane_, Dec 13 2014: (Start) %C A251413 The following properties are known (the proofs are analogous to the proofs for the corresponding facts about A098550). %C A251413 1. The sequence is infinite. %C A251413 2. At least one-third of the terms are composite. %C A251413 3. For any odd prime p, there is a term that is divisible by p. %C A251413 4. Let a(n_p) be the first term that is divisible by p. Then a(n_p) = q*p where q is an odd prime less than p. If p < r are primes then n_p < n_r. (End) %D A251413 L. Edson Jeffery, Posting to Sequence Fans Mailing List, Dec 01 2014 %H A251413 N. J. A. Sloane, <a href="/A251413/b251413.txt">Table of n, a(n) for n = 1..11945</a> %H A251413 David L. Applegate, Hans Havermann, Bob Selcoe, Vladimir Shevelev, N. J. A. Sloane, and Reinhard Zumkeller, <a href="http://arxiv.org/abs/1501.01669">The Yellowstone Permutation</a>, arXiv preprint arXiv:1501.01669, 2015 and <a href="https://cs.uwaterloo.ca/journals/JIS/VOL18/Sloane/sloane9.html">J. Int. Seq. 18 (2015) 15.6.7</a>. %p A251413 N:= 10^3: # to get a(1) to a(n) where a(n+1) is the first term > N %p A251413 B:= Vector(N, datatype=integer[4]): %p A251413 for n from 1 to 3 do A[n]:= 2*n-1: od: %p A251413 for n from 4 do %p A251413 for k from 4 to N do %p A251413 if B[k] = 0 and igcd(2*k-1, A[n-1]) = 1 and igcd(2*k-1, A[n-2]) > 1 then %p A251413 A[n]:= 2*k-1; %p A251413 B[k]:= 1; %p A251413 break %p A251413 fi %p A251413 od: %p A251413 if 2*k-1 > N then break fi %p A251413 od: %p A251413 seq(A[i], i=1..n-1); # Based on _Robert Israel_'s program for A098550 %t A251413 max = 54; f = True; a = {1, 3, 5}; NN = Range[4, 1000]; s = 2*NN - 1; While[TrueQ[f], For[k = 1, k <= Length[s], k++, If[Length[a] < max, If[GCD[a[[-1]], s[[k]]] == 1 && GCD[a[[-2]], s[[k]]] > 1, a = Append[a, s[[k]]]; s = Delete[s, k]; k = 0; Break], f = False]]]; a (* _L. Edson Jeffery_, Dec 02 2014 *) %o A251413 (Python) %o A251413 from math import gcd %o A251413 A251413_list, l1, l2, s, b = [1,3,5], 5, 3, 7, {} %o A251413 for _ in range(1,10**4): %o A251413 i = s %o A251413 while True: %o A251413 if not i in b and gcd(i,l1) == 1 and gcd(i,l2) > 1: %o A251413 A251413_list.append(i) %o A251413 l2, l1, b[i] = l1, i, True %o A251413 while s in b: %o A251413 b.pop(s) %o A251413 s += 2 %o A251413 break %o A251413 i += 2 # _Chai Wah Wu_, Dec 07 2014 %o A251413 (Haskell) %o A251413 import Data.List (delete) %o A251413 a251413 n = a251413_list !! (n-1) %o A251413 a251413_list = 1 : 3 : 5 : f 3 5 [7, 9 ..] where %o A251413 f u v ws = g ws where %o A251413 g (x:xs) = if gcd x u > 1 && gcd x v == 1 %o A251413 then x : f v x (delete x ws) else g xs %o A251413 -- _Reinhard Zumkeller_, Dec 25 2014 %Y A251413 Cf. A098550, A251414. %K A251413 nonn %O A251413 1,2 %A A251413 _N. J. A. Sloane_, Dec 02 2014