OFFSET
1,2
COMMENTS
Is this sequence a permutation of the positive integers?
Alternatively, let a(1) = 1 and S = Sum_{i=1..n-1} a(i); a(n) = smallest positive k != a(i), i < n, such that all primes p | k also either divide or exceed S. - Michael De Vlieger, Apr 22 2024
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
EXAMPLE
The sum of the first 7 terms of the sequence is 30. The positive integers <= 30 and coprime to 30 are 1,7,11,13,17,19,23,29. The smallest positive integer not occurring among the first 7 terms of the sequence which is coprime to 1,7,11,13,17,19,23,29 is 8. (7 does not occur among the first 7 terms of {a(k)}, but 7 is not coprime to 7.) So a(8) = 8.
MATHEMATICA
f[n_] := Select[Range[n], GCD[ #, n] == 1 &]; g[l_List] := Block[{k = 1, t = f[Plus @@ l]}, While[MemberQ[l, k] || Times @@ GCD[t, k] > 1, k++ ]; Append[l, k]]; Nest[g, {1}, 70] (* Ray Chandler, Dec 24 2006 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Dec 22 2006
EXTENSIONS
Extended by Ray Chandler, Dec 24 2006
STATUS
approved