%I #57 Oct 27 2023 02:25:51
%S 1,2,3,5,4,6,8,7,9,10,19,29,12,41,53,14,67,15,16,31,47,13,18,62,20,22,
%T 21,43,24,134,26,25,17,27,11,28,30,32,34,33,201,36,39,35,37,38,40,42,
%U 44,46,45,49,48,97,50,51,101,52,54,56,55,57,58,23,60,83,65
%N a(1) = 1, a(2) = 2; for n > 1, a(n) = smallest positive number which has not yet appeared which has a common factor with a(n-2) + a(n-1).
%C 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.
%H Scott R. Shannon, <a href="/A337136/b337136.txt">Table of n, a(n) for n = 1..10000</a>
%H Michael De Vlieger, <a href="/A337136/a337136_1.png">Log log scatterplot of a(n)</a>, 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.
%H Scott R. Shannon, <a href="/A337136/a337136.png">Image of the first 1000000 terms</a>. The green line is y=x.
%e 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.
%e 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.
%t nn = 120;
%t c[_] := False;
%t Array[Set[{a[#], c[#]}, {#, True}] &, 2]; Set[{i, j, u},
%t Range[3]]; s = i + j;
%t Do[k = u;
%t While[Or[c[k], CoprimeQ[s, k]], k++];
%t Set[{a[n], c[k], i, j, s}, {k, True, j, k, j + k}];
%t If[k == u, While[c[u], u++]], {n, 3, nn}];
%t Array[a, nn] (* _Michael De Vlieger_, Oct 26 2023 *)
%o (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
%Y Cf. A064413, A336957, A098550, A089088, A251622.
%Y See also A366473 and A366474.
%K nonn,easy
%O 1,2
%A _Scott R. Shannon_, Aug 18 2020
|