OFFSET
1,1
LINKS
J. C. Lagarias, E. M. Rains and N. J. A. Sloane, The EKG sequence, Exper. Math. 11 (2002), 437-446.
MATHEMATICA
nmax = 500;
ekg[s_] := Block[{m = s[[-1]], k = 3}, While[MemberQ[s, k] || GCD[m, k] == 1, k++]; Append[s, k]];
EKG = Nest[ekg, {1, 2}, nmax];
For[n = 1, n <= nmax, n++, If[EKG[[n+1]] == n, Print[n]]] (* Jean-François Alcover, Feb 13 2019, after Robert G. Wilson v in A064413 *)
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Jonathan Ayres (Jonathan.ayres(AT)btinternet.com), Sep 30 2001
EXTENSIONS
No others below 10000 - Vladeta Jovovic, Oct 03 2001
No others below 10954981 - Eric M. Rains (rains(AT)caltech.edu), Oct 05, 2001.
STATUS
approved