A340779 a(1)=1, a(2)=2; 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-1), but none with a(n-2). In case of a tie, choose the smaller.
1, 2, 6, 15, 35, 28, 26, 39, 33, 22, 20, 45, 51, 34, 38, 57, 63, 56, 58, 87, 93, 62, 68, 85, 75, 72, 74, 185, 175, 168, 166, 415, 405, 402, 404, 505, 495, 492, 494, 481, 407, 396, 394, 985, 975, 972, 974, 2435, 2425, 2328, 2326, 5815, 5805, 5802, 5804, 7255, 7245, 7242, 7244, 9055
Offset: 1
Keywords
Examples
a(5) = 35 as a(4) = 15 = 3*5 and a(3) = 6 = 2*3, thus a(5) must be a multiple of 5 while not being a multiple of 3, and must have a prime factor other than 5. The smallest unused number closest to 15 satisfying these criteria is 35. a(6) = 28 as a(5) = 35 = 5*7 and a(4) = 15 = 3*5, this a(6) must be a multiple of 7 while not being a multiple of 5, and must have a prime factor other than 7. The smallest number satisfying these criteria is 14. However 28 also does and is only 7 away from a(5), while 14 is 21 away, thus 28 is chosen. This is the first term that differs from A336957.
Comments