A340783 a(n) = n if n <= 3; for n>3, a(n) = the closest number to a(n-1) that has not occurred earlier and has at least one common factor with a(n-2), but none with a(n-1). In case of a tie, choose the smaller.
1, 2, 3, 4, 9, 8, 15, 14, 5, 6, 25, 24, 35, 34, 45, 44, 39, 38, 33, 32, 27, 26, 21, 20, 7, 10, 49, 48, 77, 76, 63, 62, 57, 56, 51, 50, 69, 68, 75, 74, 81, 80, 87, 86, 93, 92, 99, 98, 111, 110, 117, 116, 123, 122, 129, 128, 135, 134, 141, 140, 153, 152, 147, 146, 133, 132, 119, 118, 105, 104, 95
Offset: 1
Examples
a(5) = 9 as a(5-2) = a(3) = 3 so a(5) must have 3 as a factor, but cannot be 6 as it cannot have common factor with a(5-1) = a(4) = 2. a(12) = 24 as a(12-2) = a(10) = 6 so a(12) must have 2 or 3 as a factor, but cannot have a factor with a(12-1) = a(11) = 25. The closest numbers to a(12-1) = a(11) = 25 which have not occurred and satisfy these criteria are 24 and 26, but 24 is chosen as it is the smaller of the two. This is the first term differing from A098550 as the later chooses the smallest number satisfying the criteria that has not occurred, namely 12.
Links
- Scott R. Shannon, Table of n, a(n) for n = 1..20000.
- Scott R. Shannon, Image of the first 5 million terms. The green line is a(n)=n.
Comments