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 A089088 #28 Nov 19 2017 01:38:47 %S A089088 1,2,4,6,3,8,9,10,5,12,14,7,15,16,18,20,21,22,11,24,25,26,13,27,28,30, %T A089088 32,33,34,17,35,36,38,19,39,40,42,44,45,46,23,48,49,50,51,52,54,55,56, %U A089088 57,58,29,60,62,31,63,64,65,66,68,69,70,72,74,37,75,76,77,78,80,81,82,41,84,85,86,43,87,88,90,91,92,93,94,47,95,96,98,99 %N A089088 a(0) = 1, a(1) = 2; for n > 1, a(n) = smallest positive number not already in sequence which has GCD > 1 with some earlier term. %C A089088 This is a permutation of the natural numbers. %C A089088 For n > 2: a(n) is prime iff a(n) < a(n-1); a(A112988(n)) = A000040(n); inverse: A112990. - _Reinhard Zumkeller_, Oct 08 2005 %C A089088 For n > 3, a(n) can be described as follows: all composite numbers in natural order, with primes inserted so that every prime p immediately follows 2p. - _Ivan Neretin_, Apr 26 2015 %H A089088 Reinhard Zumkeller, <a href="/A089088/b089088.txt">Table of n, a(n) for n = 0..1000</a> %H A089088 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %t A089088 A089088 = {a[0] = 1, a[1] = 2}; a[n_] := Catch[For[k = Min[ Complement[ Range[Max[A089088] + 1], A089088]], True, k++, If[ !MemberQ[A089088, k] && Or @@ (GCD[k, #] > 1&) /@ A089088, AppendTo[A089088, k]; Throw[k]]]]; Table[a[n], {n, 0, 88}] (* _Jean-François Alcover_, Jul 18 2012 *) %t A089088 Nest[Append[#1, Block[{k = 1}, While[Nand[FreeQ[#1, k], AnyTrue[#1, ! CoprimeQ[#, k] &]], k++]; k]] &, {1, 2}, 87] (* _Michael De Vlieger_, Nov 18 2017 *) %o A089088 (Haskell) %o A089088 import Data.List (delete) %o A089088 a089088 n = a089088_list !! n %o A089088 a089088_list = 1 : 2 : f [3..] [1,2] where %o A089088 f xs ys = y : f (delete y xs) (y : ys) where %o A089088 y = head $ filter (\z -> any (> 1) $ map (gcd z) ys) xs %o A089088 -- _Reinhard Zumkeller_, Feb 27 2013 %Y A089088 Cf. A064413. %Y A089088 Cf. A112975. %K A089088 nonn,nice,easy %O A089088 0,2 %A A089088 _Leroy Quet_, Dec 04 2003 %E A089088 More terms from Victoria A Sapko (vsapko(AT)canes.gsw.edu), Jun 16 2004