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 A064418 #18 Oct 18 2019 23:12:36 %S A064418 1,2,3,4,8,12,6,18,9,27,36,16,20,5,10,15,25,30,24,28,7,14,21,35,40,32, %T A064418 44,11,22,33,55,45,50,60,42,48,52,13,26,39,65,70,49,56,63,54,66,72,64, %U A064418 68,17,34,51,85,75,80,76,19,38,57,95,90,78,84,77,88,92,23,46,69,115,100,96 %N A064418 a(1) = 1, a(2) = 2, a(3) = 3, a(4) = 4; for n > 4, a(n) = smallest number not already used such that gcd(a(n), a(n-1)) >= 4. %C A064418 A permutation of the natural numbers. %H A064418 Reinhard Zumkeller, <a href="/A064418/b064418.txt">Table of n, a(n) for n = 1..10000</a> %H A064418 J. C. Lagarias, E. M. Rains and N. J. A. Sloane, <a href="http://arXiv.org/abs/math.NT/0204011">The EKG sequence</a>, Exper. Math. 11 (2002), 437-446. %H A064418 <a href="/index/Ed#EKG">Index entries for sequences related to EKG sequence</a> %H A064418 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %t A064418 A064418 = Range[4]; Do[ For[ an=5, True, an++, If[GCD[an, Last[A064418]] >= 4 && FreeQ[A064418, an], AppendTo[A064418, an]; Break[]]], {70}]; A064418 (* _Jean-François Alcover_, May 07 2012 *) %o A064418 (Haskell) %o A064418 import Data.List (delete) %o A064418 a064418 n = a064418_list !! (n-1) %o A064418 a064418_list = 1 : 2 : 3 : 4 : (f 4 [5..]) where %o A064418 f :: Integer -> [Integer] -> [Integer] %o A064418 f x xs = m : (f m $ delete m xs) where %o A064418 m = head $ dropWhile ((< 4) . (gcd x)) xs %o A064418 -- _Reinhard Zumkeller_, Feb 20 2011 %Y A064418 Cf. A064413. Inverse permutation: A064958. %K A064418 nonn,nice,easy %O A064418 1,2 %A A064418 Jonathan Ayres (Jonathan.ayres(AT)btinternet.com), Sep 30 2001 %E A064418 More terms from _Naohiro Nomoto_, Sep 30 2001