OFFSET
1,1
LINKS
T. D. Noe, Table of n, a(n) for n=1..1000
J. C. Lagarias, E. M. Rains and N. J. A. Sloane, The EKG sequence, arXiv:math/0204011 [math.NT], 2002.
J. C. Lagarias, E. M. Rains and N. J. A. Sloane, The EKG sequence, Exper. Math. 11 (2002), 437-446.
MATHEMATICA
terms = 80;
ekg[s_] := Block[{m = s[[-1]], k = 3}, While[MemberQ[s, k] || GCD[m, k] == 1, k++]; Append[s, k]];
EKG = Nest[ekg, {2, 4}, 12 terms];
fp[n_] := FirstPosition[EKG, Prime[n]][[1]];
Array[fp, terms] // Differences (* Jean-François Alcover, Sep 02 2018, after Robert G. Wilson v in A064413 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Oct 01 2001
STATUS
approved