A377182 Lexicographically earliest infinite sequence of distinct positive integers such that, for n > 2, a(n) shares a factor with a(n-2) mod a(n-1) while a(n-1) mod a(n) has not previously occurred as the mod value for any consecutive pair of terms.
2, 3, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 26, 27, 28, 30, 32, 25, 35, 40, 42, 44, 33, 55, 36, 38, 39, 34, 45, 46, 48, 50, 51, 52, 54, 56, 57, 58, 60, 62, 63, 64, 66, 68, 69, 70, 72, 49, 92, 98, 100, 102, 65, 74, 75, 76, 78, 80, 81, 82, 84, 86, 87, 88, 90, 77, 91, 99, 104, 105, 106, 108, 110, 93, 119, 120, 126, 85, 123, 125, 96, 116, 117, 118, 129, 130
Offset: 1
Examples
a(4) = 6 as a(2) mod a(3) = 3 mod 4 = 3, and 6 is the earliest unused number that shares a factor with 3 while 3 has not occurred as a mod value for any previous pair. a(9) = 14 as a(7) mod a(8) = 10 mod 12 = 10, and 14 factor with 10. Note that 5 is unused and shares a factor with 10 but a(8) mod 5 = 12 mod 5 = 2, but 2 has previously occurred as the mod value for a(1) mod a(2), so 5 cannot be used. This is the first term to differ from A377078.
Links
- Scott R. Shannon, Table of n, a(n) for n = 1..10000
- Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^17, showing primes in red, perfect prime powers in gold, squarefree composites in green, and numbers neither squarefree nor prime powers in blue and purple, accentuating powerful numbers that are not prime powers in purple.
- Scott R. Shannon, Image of the first 100000 terms. The green line is a(n) = n.
Programs
-
Mathematica
nn = 120; c[] := False; m[] := False; Array[Set[{a[#], c[# + 1]}, {# + 1, True}] &, 2]; Set[{i, j, v}, {a[1], a[2], 2}]; mj = Mod[i, j]; Array[Set[m[#], True] &, mj + 1, 0]; Do[k = v; While[Set[mk, Mod[j, k]]; Or[c[k], m[mk], m[k], CoprimeQ[mj, k]], k++]; While[m[v], v++]; Set[{a[n], c[k], m[mk], i, j, mj}, {k, True, True, j, k, mk}], {n, 3, nn}]; Array[a, nn] (* Michael De Vlieger, Oct 19 2024 *)
Comments