A337136 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).
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, 21, 43, 24, 134, 26, 25, 17, 27, 11, 28, 30, 32, 34, 33, 201, 36, 39, 35, 37, 38, 40, 42, 44, 46, 45, 49, 48, 97, 50, 51, 101, 52, 54, 56, 55, 57, 58, 23, 60, 83, 65
Offset: 1
Examples
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.
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.
Programs
-
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 *)
-
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
Comments