OFFSET
1,2
EXAMPLE
39 and 99 occur in this sequence as 39 has factors 3 and 13, which are not members, while 99 has factors 3 and 11, but 39 is not a factor of 99. Also, the pairwise differences are 1, 3, 4, 2, 5, 6, 10, 12, 15, 16, for the members 1 to 17, the next available integer is 24, but it is divisible by 2, 25 is divisible by 5, 27 has difference 10, etc, until we reach 31. 14, 24, 26, 29 and 30 are new differences to avoid, and 39 becomes a(7).
MATHEMATICA
count=2; seq=Table[1, {a, 1, 3000000}]; nonarth=seq; nonarth[[1]]=1; nonarth[[2]]=2; nonarth=DeleteDuplicates[Flatten[Sort[nonarth]]]; arthcnt=Length[nonarth]; diffs=seq; diffs[[1]]=1; diffs=DeleteDuplicates[diffs]; tmpdiffs=seq; diffcnt=1; arthcnt=2; move=0; test=nonarth[[count]]+1; Parallelize[While[count<=500, a=1; While[And[a<=arthcnt, move==0], tmpdiffs[[a]]=Abs[test-onarth[[a]]]; If[And[a>1, Mod[test, nonarth[[a]]]==0], move++]; If[MemberQ[diffs, tmpdiffs[[a]]], move++]; a++; ]; If[move==0, PrependTo[nonarth, test]; nonarth=DeleteDuplicates[Flatten[Sort[nonarth]]]; arthcnt=Length[nonarth]; count++; test++; PrependTo[diffs, tmpdiffs]; diffs=DeleteDuplicates[Flatten[Sort[diffs]]]; If[Length[diffs]>3000000, count=501, diffcnt=Length[diffs]]; tmpdiffs=seq; , move=0; tmpdiffs=seq; test++; ]; ]; ];
CROSSREFS
KEYWORD
nonn
AUTHOR
Christopher Brice Turner, Mar 13 2015
STATUS
approved