OFFSET
1,2
COMMENTS
A permutation of the natural numbers.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
J. C. Lagarias, E. M. Rains and N. J. A. Sloane, The EKG sequence, Exper. Math. 11 (2002), 437-446.
MATHEMATICA
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 *)
PROG
(Haskell)
a064419 n = a064419_list !! (n-1)
a064419_list = [1, 2, 3, 4, 5] ++ f 5 [] [6..] where
f z xs (y:ys) | y `gcd` z > 4 = y : f y [] (reverse xs ++ ys)
| otherwise = f z (y:xs) ys
-- Reinhard Zumkeller, Sep 17 2001
(Python)
from sympy import gcd
l=list(range(1, 6))
for n in range(5, 101):
k=6
while k in l or gcd(l[n - 1], k)<5: k+=1
l.append(k)
print(l) # Indranil Ghosh, Jun 27 2017
CROSSREFS
KEYWORD
nonn,nice,easy
AUTHOR
Jonathan Ayres (Jonathan.ayres(AT)btinternet.com), Sep 30 2001
EXTENSIONS
More terms from Naohiro Nomoto, Sep 30 2001
STATUS
approved