OFFSET
1,2
COMMENTS
Conjecture: This is a permutation of the natural numbers. Up to 1 million terms the only fixed points are 1,2,3,6,9,10, and it is likely that there are no others.
LINKS
Scott R. Shannon, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Log log scatterplot of a(n), n = 1..1024, showing primes in red, composite prime powers in gold, squarefree composites in green, and numbers neither squarefree nor prime powers in blue, highlighting in light blue those numbers in the last mentioned category whose prime power exponents all exceed 1.
Scott R. Shannon, Image of the first 1000000 terms. The green line is y=x.
EXAMPLE
a(5) = 4 as a(3) + a(4) = 3 + 5 = 8, and 4 is the smallest number that shares a common factor with 8 that has not yet appeared.
a(11) = 19 as a(9) + a(10) = 9 + 10 = 19, and as 19 is prime, a(11) must be the smallest multiple of 19 that has not yet appeared, being 19 in this case.
MATHEMATICA
nn = 120;
c[_] := False;
Array[Set[{a[#], c[#]}, {#, True}] &, 2]; Set[{i, j, u},
Range[3]]; s = i + j;
Do[k = u;
While[Or[c[k], CoprimeQ[s, k]], k++];
Set[{a[n], c[k], i, j, s}, {k, True, j, k, j + k}];
If[k == u, While[c[u], u++]], {n, 3, nn}];
Array[a, nn] (* Michael De Vlieger, Oct 26 2023 *)
PROG
(PARI) lista(nn) = v=[1, 2]; for(n=3, nn, t=1; while(prod(X=1, n-1, v[X]-t)==0 || gcd(v[n-2]+v[n-1], t)==1, t++); v=concat(v, t); ); v; \\ Yifan Xie, May 18 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Scott R. Shannon, Aug 18 2020
STATUS
approved