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 A064417 #22 Oct 18 2019 00:21:24 %S A064417 1,2,3,6,9,12,4,8,16,20,5,10,15,18,21,7,14,28,24,27,30,25,35,40,32,36, %T A064417 33,11,22,44,48,39,13,26,52,56,42,45,50,55,60,51,17,34,68,64,72,54,57, %U A064417 19,38,76,80,65,70,49,63,66,69,23,46,92,84,75,78,81,87,29,58,116,88,77,91 %N A064417 a(1) = 1, a(2) = 2, a(3) = 3; for n >3 a(n) = smallest number not already used such that gcd(a(n), a(n-1)) >= 3. %C A064417 A permutation of the natural numbers. %H A064417 Reinhard Zumkeller, <a href="/A064417/b064417.txt">Table of n, a(n) for n = 1..10000</a> %H A064417 J. C. Lagarias, E. M. Rains and N. J. A. Sloane, <a href="https://arxiv.org/abs/math/0204011">The EKG sequence</a>, arXiv:math/0204011 [math.NT], 2002; Exper. Math. 11 (2002), 437-446. %H A064417 J. C. Lagarias, E. M. Rains and N. J. A. Sloane, <a href="https://www.jstor.org/stable/2695341">Problem 10927</a>, Amer. Math. Monthly, 109 (2002), 202; <a href="https://www.jstor.org/stable/4145228">The EKG Sequence: 10927</a>, 111 (No. 2, 2004), 167-168. %H A064417 <a href="/index/Ed#EKG">Index entries for sequences related to EKG sequence</a> %H A064417 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %t A064417 a[n_ /; n <= 3] := n; a[n_] := a[n] = For[aa = Array[a, n-1] // Sort; k = If[n == 4, 4, Complement[Range[aa // Last], aa] // First]; aa = Drop[aa, k-1], True, k++, If[FreeQ[aa, k], If[GCD[k, a[n-1]] >= 3, Return[k]]]]; Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Jan 28 2015 *) %o A064417 (Haskell) %o A064417 import Data.List (delete) %o A064417 a064417 n = a064417_list !! (n-1) %o A064417 a064417_list = 1 : 2 : 3 : f 3 [4..] where %o A064417 f x us = x' : f x' (delete x' us) where %o A064417 x' = head [u | u <- us, gcd u x > 2] %o A064417 -- _Reinhard Zumkeller_, Nov 13 2011 %Y A064417 Cf. A064413. A064956 gives inverse permutation. %K A064417 nonn,nice,easy %O A064417 1,2 %A A064417 Jonathan Ayres (Jonathan.ayres(AT)btinternet.com), Sep 30 2001 %E A064417 More terms from _Naohiro Nomoto_, Sep 30 2001