OFFSET
1,2
COMMENTS
It follows from the definition that if s(n) is prime then a(n+1) = 2*s(n). This happens only once in the sequence, when a(3)=6, following s(2)=3. For all n > 2 s(n) is composite. Conjectured to be a permutation of the positive integers (primes not in natural order).
LINKS
Michael De Vlieger, Log-log scatterplot of a(n) n = 1..2^17, labeling records in red, local minima in blue, and highlighting prime terms in green.
EXAMPLE
Since a(1)=1 and a(2)=2, we have s(2)=3, then a(3) is 6, the smallest unused term sharing a divisor with 3.
MATHEMATICA
nn = 2^16; c[_] = False; Array[Set[{a[#], c[#]}, {#, True}] &, 2]; u = s = 3; Do[k = u; While[Nand[! c[k], ! CoprimeQ[k, s], k != s], k++]; Set[{a[n], c[k]}, {k, True}]; s += k; If[k == u, While[c[u], u++]], {n, 3, nn}]; Array[a, nn] (* Michael De Vlieger, Oct 11 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Oct 11 2022
STATUS
approved