cp's OEIS Frontend

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.

A064419 a(n) = n for n <= 5; for n > 5, a(n) = smallest number not already used such that gcd(a(n), a(n-1)) >= 5.

This page as a plain text file.
%I A064419 #29 May 06 2021 11:05:12
%S A064419 1,2,3,4,5,10,15,20,25,30,6,12,18,9,27,36,24,8,16,32,40,35,7,14,21,28,
%T A064419 42,48,54,45,50,55,11,22,33,44,66,60,65,13,26,39,52,78,72,56,49,63,70,
%U A064419 75,80,64,88,77,84,90,81,99,108,96,102,17,34,51,68,85,95,19,38,57,76,114,120
%N A064419 a(n) = n for n <= 5; for n > 5, a(n) = smallest number not already used such that gcd(a(n), a(n-1)) >= 5.
%C A064419 A permutation of the natural numbers.
%H A064419 Reinhard Zumkeller, <a href="/A064419/b064419.txt">Table of n, a(n) for n = 1..10000</a>
%H A064419 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 A064419 <a href="/index/Ed#EKG">Index entries for sequences related to EKG sequence</a>
%H A064419 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%t A064419 Module[{gcdlist=Range[5],k},Do[k=6;While[GCD[k,Last[gcdlist]]<5 || MemberQ[ gcdlist,k],k++];AppendTo[gcdlist,k];,{80}];gcdlist] (* _Harvey P. Dale_, Apr 11 2012 *)
%o A064419 (Haskell)
%o A064419 a064419 n = a064419_list !! (n-1)
%o A064419 a064419_list = [1,2,3,4,5] ++ f 5 [] [6..] where
%o A064419    f z xs (y:ys) | y `gcd` z > 4 = y : f y [] (reverse xs ++ ys)
%o A064419                  | otherwise     = f z (y:xs) ys
%o A064419 -- _Reinhard Zumkeller_, Sep 17 2001
%o A064419 (Python)
%o A064419 from sympy import gcd
%o A064419 l=list(range(1, 6))
%o A064419 for n in range(5, 101):
%o A064419     k=6
%o A064419     while k in l or gcd(l[n - 1], k)<5: k+=1
%o A064419     l.append(k)
%o A064419 print(l) # _Indranil Ghosh_, Jun 27 2017
%Y A064419 Cf. A064413. See A064959 for inverse permutation.
%K A064419 nonn,nice,easy
%O A064419 1,2
%A A064419 Jonathan Ayres (Jonathan.ayres(AT)btinternet.com), Sep 30 2001
%E A064419 More terms from _Naohiro Nomoto_, Sep 30 2001