login
A124652
a(1)=1. a(n) = smallest positive integer not occurring earlier in the sequence such that every positive integer <= and coprime to (sum{k=1 to n-1} a(k)) is also coprime to a(n).
8
1, 2, 3, 4, 5, 9, 6, 8, 16, 12, 11, 7, 14, 28, 18, 24, 21, 27, 32, 31, 81, 10, 20, 13, 169, 22, 33, 19, 17, 39, 26, 49, 37, 44, 36, 48, 54, 64, 25, 35, 40, 29, 41, 15, 45, 30, 50, 80, 58, 52, 60, 72, 47, 1369, 42, 56, 98, 59, 57, 38, 76, 62, 116, 128, 75, 87, 23, 115, 46, 91
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
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
Sequence in context: A246279 A285112 A253565 * A250552 A048623 A262692
KEYWORD
nonn
AUTHOR
Leroy Quet, Dec 22 2006
EXTENSIONS
Extended by Ray Chandler, Dec 24 2006
STATUS
approved