login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A117532
a(n) = smallest positive integer not occurring earlier in the sequence such that Sum_{k=1..n} a(k) is coprime to n.
3
1, 2, 4, 6, 3, 7, 8, 10, 5, 11, 12, 14, 9, 15, 17, 13, 18, 20, 16, 22, 19, 23, 24, 26, 21, 27, 29, 25, 30, 32, 28, 34, 31, 35, 36, 38, 33, 39, 41, 37, 42, 44, 40, 46, 43, 47, 48, 50, 45, 51, 53, 49, 54, 56, 52, 58, 55, 59, 60, 64, 57, 61, 62, 66, 63, 67, 68, 70, 65, 71, 72, 74
OFFSET
1,2
COMMENTS
Sequence is likely to be a permutation of the positive integers, but I am uncertain. A117533(n) = Sum_{k=1..n} a(k). Sequence A117534 is the inverse permutation if this sequence is a permutation of the positive integers.
LINKS
EXAMPLE
a(4) = 6 because 6 is the smallest positive integer m not among the first 3 terms of the sequence such that 1+2+4+m is coprime to 4. 1+2+4+3 = 10 and gcd(4,10)=2; 1+2+4+5 = 12 and gcd(4,12)=4; but 1+2+4+6 = 13 and gcd(4,13)=1.
MAPLE
A117532 := proc(nmax) local a, n, nxt, asu ; a := [1] ; asu := 1 ; while nops(a) < nmax do n := nops(a)+1 ; nxt := 1 ; while nxt in a or gcd(n, asu+nxt) <> 1 do nxt := nxt+1 ; od ; a := [op(a), nxt] ; asu := asu+nxt ; od ; a ; end: A117532(80) ; # R. J. Mathar, May 10 2007
MATHEMATICA
Fold[Append[#1, Block[{k = 2}, While[Nand[FreeQ[#1, k], CoprimeQ[Total@ #1 + k, #2]], k++]; k]] &, {1}, Range[2, 72]] (* Michael De Vlieger, Sep 30 2017 *)
CROSSREFS
Sequence in context: A349543 A140645 A327724 * A287662 A278376 A358209
KEYWORD
nonn
AUTHOR
Leroy Quet, Mar 26 2006
EXTENSIONS
More terms from R. J. Mathar, May 10 2007
STATUS
approved