OFFSET
1,2
EXAMPLE
Among the first 5 terms of the sequence (1,2,4,5,8) there are 2 terms (1, 5) which are coprime to 6. So a(6) = a(5) + 2 = 10.
MATHEMATICA
f[l_] := Append[l, Last[l] + Length[Select[l, GCD[ #, Length[l] + 1] == 1 &]]]; Nest[f, {1}, 56] (* Ray Chandler, Dec 23 2005 *)
a[1] = 1; a[n_] := a[n] = a[n - 1] + Count[GCD[Array[a, n - 1], n], 1]; Array[a, 57] (* Robert G. Wilson v *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Dec 21 2005
EXTENSIONS
Extended by Ray Chandler and Robert G. Wilson v, Dec 23 2005
STATUS
approved