OFFSET
1,2
EXAMPLE
a(4)=3, a(5)=5. So a(6) is the 5th positive integer which is coprime to 3. 3 is coprime to 1,2,4,5,7,8,10,11,... So a(6) is the 5th of these, which is 7.
MATHEMATICA
f[m_, n_] := Block[{k = 0, c = n}, While[c > 0, k++; While[GCD[k, m] > 1, k++ ]; c--; ]; k]; g[l_] := Append[l, f[l[[ -2]], l[[ -1]]]]; Nest[g, {1, 2}, 40] (* Ray Chandler, Dec 31 2006 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Dec 29 2006
EXTENSIONS
Extended by Ray Chandler, Dec 31 2006
STATUS
approved