A338545 Numbers that escape to infinity when applying this algorithm: if x_i <= rev(x_i) then x_i+1 = rev(x_i) - x_i else x_i+1 = rev(x_i) + x_i.
3763, 3853, 3943, 3973, 4492, 4582, 4672, 4762, 4792, 4852, 4882, 4942, 4972, 5194, 5284, 5374, 5464, 5491, 5554, 5581, 5644, 5671, 5734, 5761, 5791, 5824, 5851, 5881, 5914, 5941, 5971, 5993, 6193, 6283, 6373, 6426, 6463, 6490, 6516, 6553
Offset: 1
Examples
x_0 = 137, x_1 = 731 - 137 = 594, x_2 = 495 + 594 = 1089, x_3 = 9801 - 1089 = 8712, x_4 = 2178 + 8712 = 10890, x_5 = 9801 + 10890 = 20691, x_6 = 19602 + 20691 = 40293, x_7 = 39204 + 40293 = 79497, x_8 = 79497 - 79497 = 0, hence 137 is not a term.
Crossrefs
Cf. A031877.
Programs
-
Python
sequence = [] escape = [1090089, 99100089, 9900109899999990109989] for k in range(1, 100000): x = k while not x==0: if x <= rev(x): x = rev(x) - x else: x = rev(x) + x if x in escape: x = 0 sequence.append(k)
Comments