A352867 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest positive number that has not appeared that shares a factor with a(n-1), a(n-2), and a(n-1)+a(n-2).
1, 2, 6, 4, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 105, 7, 21, 35, 49, 63, 77, 91, 119, 126, 133, 140, 114, 116
Offset: 1
Examples
a(4) = 4 as a(2)=2, a(3)=6, a(2)+a(3)=8, and 4 is the smallest unused number that shares a factor with 2, 6, and 8. a(58) = 105 as a(56)=110, a(57)=112, a(56)+a(57)=222, and 105 = 3*5*7 is the smallest unused number that shares a factor with 110, 112, and 222. This breaks a run of fifty-three consecutive even terms differing by 2. a(59) = 7 as a(57)=112, a(58)=105, a(57)+a(58)=217, and 7 is the smallest unused number that shares a factor with 112, 105, and 217. This is the second prime to appear after a(2)=2.
Links
- Scott R. Shannon, Table of n, a(n) for n = 1..10000
- Michael De Vlieger, Annotated log-log scatterplot of a(n), n = 1..2^10, showing intervals of terms with the same g = A007947(gcd(a(n-2), a(n-1), a(n-2)+a(n-1))) in a color function where g = 2 is black, g = 3 is red, g = 5 orange, etc. The first term in the intervals are noted in black, their index in italic below the point.
- Scott R. Shannon, Image of the first 1000 terms. The green line is y = n.
- Scott R. Shannon, Image of the first 200000 terms.
- Scott R. Shannon, Image of the first 200000 terms with parity. White are even terms, red are odd terms.
Programs
-
Mathematica
nn = 71; u = 1; c[] = 0; MapIndexed[Set[{a[First[#2]], c[#1]}, {#1, First[#2]}] &, {1, 2, 6}]; While[c[u] > 0, u++]; Do[k = u; While[Nand[c[k] == 0, ! CoprimeQ[#1, k], ! CoprimeQ[#2, k], ! CoprimeQ[#3, k]], k++] & @@ {#1, #2, #1 + #2} & @@ {a[i - 2], a[i - 1]}; Set[{a[i], c[k]}, {k, i}]; If[a[i] == u, While[c[u] > 0, u++]], {i, 4, nn}]; Array[a, nn] (* _Michael De Vlieger, Apr 28 2022 *)
Comments