A354717 Lexicographically earliest infinite sequence of distinct positive integers such that in any run of four consecutive terms there is one term which is prime to the other three, none of which are pairwise coprime.
1, 2, 4, 6, 5, 8, 12, 14, 11, 10, 16, 18, 7, 20, 15, 24, 13, 3, 9, 21, 17, 27, 30, 33, 19, 22, 36, 26, 23, 28, 32, 34, 25, 38, 42, 44, 29, 40, 46, 48, 31, 50, 45, 35, 37, 55, 60, 65, 41, 39, 52, 54, 43, 56, 58, 62, 47, 64, 66, 68, 49, 51, 72, 57, 53, 63, 69, 75
Offset: 1
Keywords
Examples
a(1,2,3,4) = 1,2,4,6 is the lexicographically earliest string of four consecutive numbers which satisfy the definition, hence the sequence starts with these terms. a(13,14,15) = 7,20,15 respectively, and 24 is the least unused number such that 7 is prime to 20,15 and 24, whereas (20,15)=5, (15,24)=3 and (20,24)=2. Therefore a(16)=24.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
- Michael De Vlieger, Scatterplot of a(n), n = 1..512, showing primes in red, odd composites in gold, and evens in blue.
Programs
-
Mathematica
Block[{a, c, k, len, u, nn}, nn = 120; c[] = 0; MapIndexed[Set[{a[First[#2]], c[#1]}, {#1, First[#2]}] &, {1, 2, 4, 6}]; len = u = 3; Do[k = u; While[Nand[c[k] == 0, Union@ Tally@ Map[Count[#, 1] &, Outer[GCD, #, #]] == {{1, len}, {len, 1}} &@ {a[i - 3], a[i - 2], a[i - 1], k}], k++]; Set[{a[i], c[k]}, {k, i}], {i, len + 2, nn}]; Array[a, nn] ] (* _Michael De Vlieger, Jun 05 2022 *)
Comments