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 A064664 #36 Feb 16 2025 08:32:45 %S A064664 1,2,5,3,10,4,14,8,6,9,20,7,28,13,11,17,33,12,37,18,15,19,43,16,24,27, %T A064664 22,26,57,23,61,31,21,32,25,30,67,36,29,40,74,35,81,41,39,42,89,45,50, %U A064664 46,34,47,100,48,53,49,38,56,107,52,115,60,51,64,54,59,128,65,44,55 %N A064664 Regard A064413 as giving a permutation of the positive integers; sequence gives inverse permutation. %C A064664 The Mathematica program computes the EKG sequence A064413 and then determines the inverse permutation. - _T. D. Noe_, Nov 13 2002 %H A064664 Ray Chandler, <a href="/A064664/b064664.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from T. D. Noe) %H A064664 J. C. Lagarias, E. M. Rains, and N. J. A. Sloane, <a href="https://projecteuclid.org/journals/experimental-mathematics/volume-11/issue-3/The-EKG-Sequence/em/1057777433.full">The EKG sequence</a>, Exper. Math. 11 (2002), 437-446; <a href="https://arxiv.org/abs/math/0204011">arXiv preprint</a>, arXiv:math/0204011 [math.NT], 2002. %H A064664 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/EKGSequence.html">EKG Sequence</a>. %H A064664 <a href="/index/Ed#EKG">Index entries for sequences related to EKG sequence</a>. %H A064664 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %e A064664 Original permutation has cycles (1) (2) (3, 4, 6, 9, 10, 5) (..., 20, 18, 12, 7, 14, 13, 28, 26, ...) (8) ... %t A064664 maxN=200; lst={1, 2}; unused=Range[3, maxN]; found=True; While[found, found=False; i=0; While[ !found&&i<Length[unused], i++; If[GCD[lst[[ -1]], unused[[i]]]>1, found=True; AppendTo[lst, unused[[i]]]; unused=Delete[unused, i]]]]; Take[Ordering[lst], unused[[1]]-1] %o A064664 (Haskell) %o A064664 import Data.List (elemIndex); import Data.Maybe (fromJust) %o A064664 a064664 = (+ 1) . fromJust . (`elemIndex` a064413_list) %o A064664 -- _Reinhard Zumkeller_, May 01 2014, Sep 17 2011 %Y A064664 Cf. A064413, A064665, A064666, A064667, A064668, A064669. %Y A064664 Equals A064421 + 1. %K A064664 nonn %O A064664 1,2 %A A064664 _N. J. A. Sloane_, Oct 11 2001