OFFSET
0,1
EXAMPLE
The positive integers coprime to 6 are 1,5,7,11,13,17,19,23,25,29,31,...Since a(5) = 8, a(6) is 23, the 8th integer in the sequence of positive integers coprime to 6.
MAPLE
copr := proc(i, n) local res, j ; res := 1 ; j := 1; while j<i do res := res+1 ; while gcd(res, n) > 1 do res := res+1 ; od ; j := j+1 ; od ; RETURN(res) ; end; A125554 := proc(nmax) local a, anext; a := [2] ; while nops(a) < nmax do anext := copr(op(-1, a), nops(a)) ; a := [op(a), anext] ; od ; RETURN(a) ; end ; A125554(26) ; # R. J. Mathar, Jan 07 2007
MATHEMATICA
f[m_, n_] := Block[{k, c, x}, x = Floor[m/EulerPhi[n]] - 1; k = x*n; c = m - x*EulerPhi[n]; While[c > 0, k++; While[GCD[k, n] > 1, k++ ]; c--; ]; k]; g[l_List] := Append[l, f[l[[ -1]], Length[l]]]; Nest[g, {2}, 36] (* Ray Chandler, Jan 05 2007 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Dec 30 2006
EXTENSIONS
Extended by Ray Chandler, Jan 05 2007
STATUS
approved
