OFFSET
1,2
COMMENTS
The sequence contains long runs on even terms, differing by 2, and odd terms, differing by various small even numbers. These runs are often interrupted by a large prime that becomes the new largest term. As this and the previous largest term are typically much larger than any other value the sequence then begins a long series of steadily increasing values that share a factor with the sum of these two largest terms.
The sequence is conjectured to be a permutation of the positive integers, although it apparently takes many terms for some primes to appear, e.g., after 200000 terms 73 has not occurred. The primes do not occur in their natural order. Beyond the first three terms there are nine fixed points in the first 200000 terms, although it is likely more exist.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Annotated log-log scatterplot of a(n), n = 1..2^14, showing records in red, local minima in blue, highlighting primes in green and fixed points in gold.
Scott R. Shannon, Image of the first 200000 terms. The green line is y = n.
Rémy Sigrist, C++ program
EXAMPLE
a(4) = 5 as the sum of the largest and second-largest value of all previous terms is a(3) + a(2) = 3 + 2 = 5, and 5 is the smallest unused number that shares a factor with 5.
a(10) = 8 as the sum of the largest and second-largest value of all previous terms is a(8) + a(7) = 17 + 11 = 28, and 8 is the smallest unused number that shares a factor with 28.
MATHEMATICA
nn = 120; c[_] = 0; s = a[1] = c[1] = 1; r = a[2] = c[2] = 2; u = 3; Do[k = u; m = r + s; While[Nand[c[k] == 0, ! CoprimeQ[k, m]], k++]; Set[{a[i], c[k]}, {k, i}]; If[k > s, s = k]; If[k > r, s = r; r = k]; If[k == u, While[c[u] > 0, u++]], {i, 3, nn}]; Array[a, nn] (* Michael De Vlieger, May 08 2022 *)
PROG
(C++) See Links section.
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Scott R. Shannon, May 06 2022
STATUS
approved