OFFSET
1,2
COMMENTS
In the first 250000 terms the lowest number not to appear is 811; it is likely this sequence is a permutation of the positive integers. In this range the fixed points are 1, 2, 4, 35, 6731, 167821. It is possible more exist although this is unknown. In the same range the longest runs of consecutive even terms and odd terms is 29 and 33 respectively. This suggests such runs are likely arbitrarily long.
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^16, showing records in red, local minima in blue, fixed points in gold, and highlighting primes in green.
Scott R. Shannon, Image of the first 250000 terms. The green line is y = n.
EXAMPLE
a(3) = 6 as a(1)+a(2)=3, a(1)*a(2)=2, and 6 is the smallest unused number that shares a factor with both 3 and 2.
MATHEMATICA
nn = 74; c[_] = 0; a[1] = c[1] = 1; a[2] = c[1] = 2; u = 1; While[c[u] > 0, u++]; Do[k = u; While[Nand[c[k] == 0, GCD[#1, k] > 1, GCD[#2, k] > 1], k++] & @@ {#1 + #2, #1 #2} & @@ {a[i - 2], a[i - 1]}; Set[{a[i], c[k]}, {k, i}]; If[k == u, While[c[u] > 1, u++]], {i, Length[s] + 1, nn}]; Array[a, nn] (* Michael De Vlieger, Apr 02 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Apr 02 2022
STATUS
approved