OFFSET
1,2
COMMENTS
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..3000
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
KEYWORD
nonn
AUTHOR
Leroy Quet, Mar 26 2006
EXTENSIONS
More terms from R. J. Mathar, May 10 2007
STATUS
approved