OFFSET
1,2
COMMENTS
A permutation of the natural numbers.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000 (first 2000 terms from Ivan Neretin)
J. C. Lagarias, E. M. Rains and N. J. A. Sloane, The EKG sequence, Exper. Math. 11 (2002), 437-446.
J. C. Lagarias, E. M. Rains and N. J. A. Sloane, The EKG sequence, arXiv:math/0204011 [math.NT], 2002.
MAPLE
ina:= proc(n) evalb(n<7) end:
a:= proc(n) option remember;
local k;
if n<7 then n
else for k while ina(k) or igcd (k, a(n-1))<6 do od;
ina(k):= true; k
fi
end;
seq(a(n), n=1..60);
MATHEMATICA
t=Range[6]; Do[k=7; While[MemberQ[t, k] || GCD[t[[-1]], k] < 6, k++]; AppendTo[t, k], {n, 7, 100}]; t
PROG
(Python)
from sympy import gcd
l=list(range(1, 7))
for n in range(6, 101):
k=7
while k in l or gcd(l[n - 1], k)<6: k+=1
l.append(k)
print(l) # Indranil Ghosh, Jun 27 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jonathan Vos Post, Dec 16 2010
EXTENSIONS
Edited by Alois P. Heinz, Dec 16 2010
STATUS
approved